atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

Misleading comment in js file bundled with wasm version of kdf

Open gcharang opened this issue 5 months ago • 2 comments

Describe the bug In the latest release ( https://github.com/KomodoPlatform/komodo-defi-framework/releases/tag/v2.5.0-beta ) the kdflib.js file has misleading jsdoc comment

import init, {mm2_main, LogLevel, StartupResultCode} from "./path/to/mm2.js";
const params = {
    conf: { "gui":"WASMTEST", mm2:1, "passphrase":"YOUR_PASSPHRASE_HERE", "rpc_password":"test123", "coins":[{"coin":"ETH","protocol":{"type":"ETH"}}] },
    log_level: LogLevel.Info,
};
let handle_log = function (_level, line) { console.log(line) };
try {
    mm2_main(params, handle_log);
} catch (e) {
    switch (e.code) {
        case StartupResultCode.AlreadyRunning:
            alert("MarketMaker2 already runs...");
            break;
        // handle other errors...
        default:
            alert(`Unexpected error: ${e}`);
            break;
    }
}

gcharang avatar Jul 09 '25 15:07 gcharang

StartupResultCode is not exported and the conf in this example and others need to be updated to a working version

gcharang avatar Jul 09 '25 15:07 gcharang

Although it's low priority, it's trivial to fix, so targeting next release.

shamardy avatar Jul 10 '25 11:07 shamardy