Skip to content

Support sample application using haveno-ts library [3 XMR] #1482

@woodser

Description

@woodser

This issue requests getting the sample Node.js application to work using the haveno-ts library.

Currently, haveno-ts does not package its dist assets correctly to be used as a NPM dependency via npm install haveno-ts, causing this error when used:

Error: Cannot find module './HavenoClient'

There is a pull request in progress, haveno-dex/haveno-ts#332, to start fixing haveno-ts to be used as a NPM dependency, but it's only meant as a starting point.

Apply the PR to haveno-ts and run these steps to test the latest fixes in the sample application:

  1. cd haveno-ts
  2. npm install
  3. npm pack
  4. cd ~/git/haveno-sample-app
  5. npm install ../haveno-ts/haveno-ts-0.0.30.tgz
  6. npm run start

With the fixes from the PR applied, you should see this output in the sample application for further debugging:

Sample app using haveno-ts
/Users/woodser/git/haveno-sample-app/node_modules/haveno-ts/dist/HavenoClient.js:666
            throw new HavenoError_1.default(e.message, e.code);
                  ^

HavenoError: XMLHttpRequest is not defined
    at HavenoClient.getBalances (/Users/woodser/git/haveno-sample-app/node_modules/haveno-ts/dist/HavenoClient.js:666:19)
    at async main (file:///Users/woodser/git/haveno-sample-app/dist/index.js:8:22) {
  code: undefined
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    💰bountyThere is a bounty on this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions