| Crates.io | keystone-wasm |
| lib.rs | keystone-wasm |
| version | 0.1.0-alpha.1 |
| created_at | 2026-01-24 12:14:28.958677+00 |
| updated_at | 2026-01-24 12:14:28.958677+00 |
| description | WASM bindings for Keystone financial computation |
| homepage | |
| repository | https://github.com/dijkstra-keystone/keystone |
| max_upload_size | |
| id | 2066589 |
| size | 18,729 |
WASM bindings for Keystone financial computation.
npm install @dijkstra-keystone/wasm
import init, * as keystone from '@dijkstra-keystone/wasm';
async function main() {
await init();
// Arithmetic
keystone.add("100.50", "49.50"); // "150"
keystone.multiply("99.99", "1.08"); // "107.9892"
keystone.divide("100", "3"); // "33.333..."
// Rounding
keystone.round("123.456", 2, "half_up"); // "123.46"
// Financial
keystone.compound_interest("10000", "0.05", 12, 5);
keystone.future_value("10000", "0.07", 10);
// Risk
keystone.health_factor("10000", "5000", "0.80"); // "1.6"
keystone.liquidation_price("5", "10000", "0.80");
}
add(a, b), subtract(a, b), multiply(a, b), divide(a, b)abs(value), compare(a, b), min(a, b), max(a, b)round(value, dp, mode) - Modes: "half_even", "half_up", "down", "up", etc.floor(value), ceil(value), trunc(value)simple_interest, compound_interest, effective_annual_ratefuture_value, present_value, net_present_valuepercentage_of, percentage_changehealth_factor, is_healthy, collateral_ratioliquidation_price, max_borrowableloan_to_value, utilization_rateLicensed under either of Apache License, Version 2.0 or MIT license at your option.