Circles Transfer
Utility module for Circles to find the Maximum flow and necessary transitive transfers steps in a trust graph with multiple tokens.
Requirements
- NodeJS
Installation
npm i @circles/transfer
Usage
; // Define a weighted trust graph between trusted tokens. Each edge describes// how much ("capacity") of what token ("token") can be sent from which node// ("from") to which ("to"):const nodes = 'A' 'B' 'C' 'D'; const edges = from: 'A' to: 'B' token: 'A' capacity: 10 from: 'B' to: 'C' token: 'B' capacity: 7 from: 'B' to: 'C' token: 'C' capacity: 5 ...; // Find required transfer steps to send transfer transitively between two nodes:const transferSteps maxFlowValue = ; // ... we get the maximum possible value:console; // ... and finally the transfer steps:transferSteps;
Development
circles-transfer
is a JavaScript module written in JavaScript, tested with Jest, transpiled with Babel and bundled with Rollup.
// Install dependencies
npm install
// Run test suite
npm run test
npm run test:watch
// Check code formatting
npm run lint
// Build it!
npm run build
License
GNU Affero General Public License v3.0 AGPL-3.0