Files
monero_c/impls/monero.ts
Mateusz Franik 85770ea6f1 tests: run integration and regression tests on other platforms (#93)
* tests: add script to download test dependencies from fallback mirrors

* tests: use the new download_deps script, run tests on macos

* ci: download proper artifact for macos

* chore: make download_deps script download everything to dir named `monero_c` when ran directly

* tests: await downloading deps

* tests download  proper monero_c version in prepareMoneroC

* tests: fix typos

* tests: add file data for more targets

* tests: print why retrieving tags failed

* chore: change mirror url endpoint from `monero_c` to `download_mirror`

* tests: use cached releases endpoint to prevent ratelimits

* ci: remove brew@1.76 dependency

* tests: fix macos dylib path

* feat!(monero.ts): make `createTransactionMultDest` optionally return `null`

* feat(monero.ts): make `Wallet_reconnectDevice` symbol optional

* tests: don't try to extract file if out already exists

* tests: remove unnecesary directory rm calls

* ci: set regression tests to use canary
2024-12-30 10:39:28 +01:00
..
2024-09-19 10:59:07 +02:00
2024-09-19 10:59:07 +02:00

monero.ts

monero_c bindings for Deno.

Usage

This library does not ship with monero_c libraries.
To use these bindings you have to bring your own monero_c libraries.
There are at least two ways to do so:

  • Ahead-of-time, during builds where you only ship necessary library for a given platform.
    See monero-tui build workflow as an example of doing so.
    import {
      loadMoneroDylib,
      Wallet,
      WalletManager,
    } from "https://raw.githubusercontent.com/MrCyjaneK/monero_c/master/impls/monero.ts/mod.ts";
    
    // Try to load dylib from the default lib/* path
    // You can also use loadWowneroDylib for Wownero
    loadMoneroDylib();
    
    const wm = await WalletManager.new();
    const wallet = await wm.createWallet("./my_wallet", "password");
    
    console.log(await wallet.address());
    
    await wallet.store();
    
  • Just-in-time, where you download and cache the library at runtime.
    You can use something like plug to achieve the result.
    import { dlopen } from "jsr:@denosaurs/plug";
    // It's recommened to put the monero.ts github link into your import_map to reduce the url clutter
    import { loadMoneroDylib, symbols, Wallet, WalletManager } from "https://raw.githubusercontent.com/MrCyjaneK/monero_c/master/impls/monero.ts/mod.ts";
    
    // Load dylib loaded by plug
    const lib = await dlopen(..., symbols);
    loadMoneroDylib(lib);
    
    const wm = await WalletManager.new();
    const wallet = await wm.createWallet("./my_wallet", "password");
    
    console.log(await wallet.address());
    
    await wallet.store();