Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
jojapoppa 2186bd6b77 build.. 2 лет назад
dist build.. 2 лет назад
examples/example1 initial checkin 2 лет назад
lib build.. 2 лет назад
tests build.. 2 лет назад
.gitignore docs 2 лет назад
LICENSE initial checkin 2 лет назад
README.md docs 2 лет назад
build.sh build working... 2 лет назад
info.txt initial checkin 2 лет назад
package.json build.. 2 лет назад
tsconfig.json initial checkin 2 лет назад
typedoc.js initial checkin 2 лет назад
yarn.lock build.. 2 лет назад


Javascript backend for fedoragold wallet (a javascript walletd)





Provides an interface to the FedoraGold (FED) network, allowing wallet applications to be built.

  • Downloads blocks from the network, either through a traditional daemon, or a blockchain cache for increased speed
  • Processes blocks, decrypting transactions that belong to the user
  • Sends and receives transactions


You can view the documentation here

You can see a list of all the other classes on the right side of the screen. Note that you will need to prefix them all with WB. to access them, if you are not using typescript style imports, assuming you imported with const WB = require('fedoragold-wallet-backend').

Quick Start

You can find an example project in the examples folder.


const WB = require('fedoragold-wallet-backend');

(async () => {
    const daemon = new WB.Daemon('', 11898);
    /* OR
    const daemon = new WB.Daemon('blockapi.turtlepay.io', 443);

    const wallet = WB.WalletBackend.createWallet(daemon);

    console.log('Created wallet');

    await wallet.start();

    console.log('Started wallet');

    wallet.saveWalletToFile('mywallet.wallet', 'hunter2');

    /* Make sure to call stop to let the node process exit */
})().catch(err => {
    console.log('Caught promise rejection: ' + err);


import { WalletBackend, Daemon, IDaemon } from 'fedoragold-wallet-backend';

(async () => {
    const daemon: IDaemon = new Daemon('', 11898);

    /* OR
    const daemon: IDaemon = new Daemon('blockapi.turtlepay.io', 443);

    const wallet: WalletBackend = WalletBackend.createWallet(daemon);

    console.log('Created wallet');

    await wallet.start();

    console.log('Started wallet');

    wallet.saveWalletToFile('mywallet.wallet', 'hunter2');

    /* Make sure to call stop to let the node process exit */
})().catch(err => {
    console.log('Caught promise rejection: ' + err);


There are a few features which you may wish to configure that are worth mentioning.

Auto Optimize

Auto optimization is enabled by default. This makes the wallet automatically send fusion transactions when needed to keep the wallet permanently optimized.

To enable/disable this feature, use the following code:

wallet.enableAutoOptimization(false); // disables auto optimization

Coinbase Transaction Scanning

By default, coinbase transactions are not scanned. This is due to the majority of people not having solo mined any blocks.

If you wish to enable coinbase transaction scanning, run this line of code:



By default, the logger is disabled. You can enable it like so:


and in typescript:


The logger uses console.log, i.e. it outputs to stdout.

If you want to change this, or want more control over what messages are logged, you can provide a callback for the logger to call.

wallet.setLoggerCallback((prettyMessage, message, level, categories) => {
    if (categories.includes(WB.LogCategory.SYNC)) {

and in typescript:

wallet.setLoggerCallback((prettyMessage, message, level, categories) => {
    if (categories.includes(LogCategory.SYNC)) {

In this example, we only print messages that fall into the SYNC category.

You can view available categories and log levels in the documentation.



  • Fix bug when scanning coinbase transactions and not using /sync/raw


  • Upgrade fedoragold-utils and other dependencies
  • Documentation updates
  • Test suite updates


  • Fix issue halting sync when transaction is missing a transaction public key


  • Fix issue generating transactions with a ledger


  • Update fedoragold-utils
  • New events emitted when a ledger is waiting for user input


  • Fix object-sizeof being incorrectly imported


  • Fix bug where package.json was not correctly read in npm release


  • Supports v1.0.0 daemon API
  • No longer supports v0.28.3 daemon API
  • Supports using a ledger nano to control private keys
  • Can specify whether you want to sync with raw blocks or not when initializing daemon
  • Fix auto optimize disabling not working correctly
  • Warn users when using non native crypto
  • Can send extra data with tx
  • More prepared transaction functions


  • Sleeping between block download failures or when fully synced has been re-added, in a more effective way.
  • sendTransactionBasic and sendTransactionAdvanced now also returns the node fee and destinations sent to.
  • Fusion transactions are now fixed


  • It is now possible to specify multiple destinations when setting sendAll. See the new docs for more information.


  • Fix prepared transactions being incorrectly stored


  • Fix storing prepared transactions not working after loading from file
  • Fix relayToNetwork parameter not being respected


  • Add fee per byte support
  • Add sendPreparedTransaction
  • Add sendRawPreparedTransaction
  • Add deletePreparedTransaction
  • Add includeFusions param to getNumTransactions
  • Improved transaction logging

Breaking Changes

The return type of both sendTransactionBasic and sendTransactionAdvanced has changed. The type of the fee parameter for sendTransactionAdvanced has changed.

Building (For Developers)

`git clone https://git.fedoragold.com/jojapoppa/fedoragold-wallet-backend

cd fedoragold-wallet-backend

npm install -g yarn (Skip this if you already have yarn installed)

yarn install

yarn build

Generated javascript files will be written to the dist/lib/ folder.

Running tests

yarn test - This will run the basic tests

yarn test-all - This will run all tests, including performance tests.

Before making a PR

  • Ensure you are editing the TypeScript code, and not the JavaScript code (You should be in the lib/ folder)
  • Ensure you have updated the documentation if necessary - Documentation is generated from inline comments, jsdoc style.
  • Ensure you have rebuilt the documentation, if you have changed it: yarn docs
  • Ensure the tests all still pass: yarn test, or yarn test-all if you have a local daemon running.
  • If adding a feature/fixing a bug, adding a test to verify your fix/feature functions as expected would be great. But don’t sweat it.