open-index/open-npm huggingface dataset:
npm package: @forbole/uikit
Description: The Storybook design system tutorial is a subset of the full [Storybook design system](https://github.com/storybookjs/design-system/), created as a learning resource for those interested in learning how to write and publish a design system using best in p
Latest version: 1.40.0

# Storybook design system tutorial

The Storybook design system tutorial is a subset of the full [Storybook design system](https://github.com/storybookjs/design-system/), created as a learning resource for those interested in learning how to write and publish a design system using best in practice techniques.

Learn more in [Storybook tutorials](https://storybook.js.org/tutorials/).
npm package: @force-bridge/keystore
Description: A simple keystore for managing the private keys
Latest version: 0.1.7

# @force-bridge/keystore

A simple keystore for managing the private keys

## Quick Start

### Start With JSON File

```ts
import { KeyStore } from '@force-bridge/keystore';

const password = '123456';
const store = KeyStore.createFromPairs(
  {
    Alice: '0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
    Bob: '0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
  },
  password,
);

const encrypted = store.getEncryptedData();
saveToFile(JSON.stringify(encrypted));
```

### Read The Encrypted JSON file

```ts
const store = new KeyStore(fs.readFileSync(filePath).toString());

// decrypt before using the keystore
store.decrypt(process.env.KEYSTORE_PASSWORD);

store.getDecryptedByKeyID('Alice');
store.getDecryptedByKeyID('Bob');
```

### Define A Function With Required Key IDs

```ts
function AliceTransferToBob(store: KeyStore<'Alice' | 'AliceSecondary'>) {
  const privateKey = store.getDecryptedByKeyID('Alice');
  const privateKey1 = store.getDecryptedByKeyID('AliceSecondary');

  // typescript would marks error if getting with an unknown key
  // const privateKeyUnknown = store.getDecryptedByKeyID('unknown-key');

  signTransaction(tx, privateKey);
  signTransaction(tx1, privateKey1);
}
```
npm package: @force-bridge/reconc
Description: reconc module providing a commons interface `Reconciliation` for checking if `bridge from` and `bridge to` are balanced
Latest version: 0.1.7

# @force-bridge/reconc

reconc module providing a commons interface `Reconciliation` for checking if `bridge from` and `bridge to` are balanced

## Example

```ts
import { Reconciler, Reconciliation } from '@force-bridge/reconc';

class EthLockReconciler implements Reconciler {
  async getFromRecordsByOnChainState(): Promise<FromRecord[]> {
    return contractHelper.getFromRecords();
  }

  async getToRecordsByLocalState(): Promise<ToRecord[]> {
    return db.getMintRecords();
  }

  async fetchReconciliation(): Promise<Reconciliation> {
    const [from, to] = await Promise.all([this.getFromRecordsByOnChainState(), this.getToRecordsByLocalState()]);
    return new Reconciliation(from, to);
  }
}
```