Socket
Book a DemoInstallSign in
Socket

@okjodom/fm-server

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okjodom/fm-server

Library for building server-side or CLI apps with a Fedimint client. Good for Node, Bun and similar runtimes

latest
Source
npmnpm
Version
0.0.5
Version published
Maintainers
1
Created
Source

@fedimint/server

Fedimint SDK optimized for Node.js/Bun server environments.

Installation

npm install @fedimint/server
# or
yarn add @fedimint/server
# or
pnpm add @fedimint/server

Features

  • Optimized for server-side JavaScript environments (Node.js and Bun)
  • Pluggable storage adapters (LevelDB, File-based)
  • Server-specific utilities and helpers
  • Support for both ESM and CommonJS imports

Example Usage

// ESM
import { FedimintWallet } from '@fedimint/server'
import { LevelDBStorage } from '@fedimint/server/storage'

// CommonJS
const { FedimintWallet } = require('@fedimint/server')
const { LevelDBStorage } = require('@fedimint/server/storage')

// Initialize with Node.js optimized settings
const wallet = new FedimintWallet({
  storageAdapter: new LevelDBStorage('./data'),
  logLevel: 'info',
})

// Use the API the same way as in browser
await wallet.initialize()
await wallet.open('my-fedimint-client')

// Make module calls
const balance = await wallet.balance.getBalance()
console.log('Balance:', balance)

// Use Lightning module
const invoice = await wallet.lightning.createInvoice(1000, 'Test payment')
console.log('Invoice:', invoice)

Storage Adapters

LevelDB Storage

import { LevelDBStorage } from '@fedimint/server/storage'

const storage = new LevelDBStorage('./data', {
  createIfMissing: true,
})

const wallet = new FedimintWallet({
  storageAdapter: storage,
})

File Storage

import { FileStorage } from '@fedimint/server/storage'

const storage = new FileStorage('./data')

const wallet = new FedimintWallet({
  storageAdapter: storage,
})

Custom Storage Adapters

You can implement your own storage adapter by implementing the StorageAdapter interface:

import { StorageAdapter, Transaction } from '@fedimint/server/storage'

class MyCustomStorage implements StorageAdapter {
  // Implementation
}

License

MIT

FAQs

Package last updated on 22 May 2025

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