@force-bridge/reconc

0.0.39 • Public • Published

@force-bridge/reconc

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

Example

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);
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @force-bridge/reconc

Weekly Downloads

0

Version

0.0.39

License

none

Unpacked Size

6.71 kB

Total Files

9

Last publish

Collaborators

  • zzkouniya
  • walkinghog
  • darylmoe
  • homura