Code Monkey home page Code Monkey logo

paymail-client's People

Contributors

eitkfabriik avatar elijahb avatar hojarasca avatar ryanxcharles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

paymail-client's Issues

dns from http resolved the domain with appended dot '.' cause getApiDescriptionFor error when getWellKnownBaseUrl

code here https://github.com/moneybutton/paymail-client/blob/master/src/dns-client.js#L87

for example

response from https://dns.google.com/resolve?name=_bsvalias._tcp.semo3d.com&type=SRV&cd=0

{
    "Status": 0,
    "TC": false,
    "RD": true,
    "RA": true,
    "AD": true,
    "CD": false,
    "Question": [
        {
            "name": "_bsvalias._tcp.semo3d.com.",
            "type": 33
        }
    ],
    "Answer": [
        {
            "name": "_bsvalias._tcp.semo3d.com.",
            "type": 33,
            "TTL": 1112,
            "data": "10 10 443 nemo.azure-api.net."
        }
    ]
}

get domain value: nemo.azure-api.net.
will cause error

nodejs.FetchError: request to https://nemo.azure-api.net.:443/.well-known/bsvalias failed, reason: read ECONNRESET\n at ClientRequest.

Address resolution: Sender 'pubkey' OR 'senderHandle'

The identity of a sender should be able to be proven via a paymail OR their public key.
Otherwise we are enforcing that a sender MUST have a paymail handle, which may not always be the case.

https://www.moneybutton.com/api/v1/bsvalias/address/[email protected]

For example, this returns a successful response:

{
    "senderHandle" : "[email protected]",
    "amount" : 1000,
    "dt" : "2021-02-27T17::30+0000",
    "purpose" : "blah",
    "signature" : "HwbaE0o8eYPNsTt3T7LmggruS0UwS/2WYiXHpsu6VmTIOXoohm4MR+YN4Hb/mSKP2hw30DTVMc4tsmK13dy/4/I="
}

However, this does not:

{
    "amount" : 1000,
    "dt" : "2021-02-27T17::30+0000",
    "purpose" : "blah",
    "pubkey" : "02150c35fe106a25311243c0c9c9189de0b21955f69dc14e8bf401f4399a8ae905",
    "signature" : "HwbaE0o8eYPNsTt3T7LmggruS0UwS/2WYiXHpsu6VmTIOXoohm4MR+YN4Hb/mSKP2hw30DTVMc4tsmK13dy/4/I="
}

bsv is not in dependencies of the package

Steps to reproduce:

  • npm init (create a new project);
  • npm add @moneybutton/paymail-client;
  • create a JS file and write something like const { Tx } = require("@moneybutton/paymail-client");
  • launch the JS file;
  • fail:

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'bsv'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (B:\mar\paymailclient\node_modules\@moneybutton\brfc\dist\brfc.cjs.js:7:27)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2021-02-26T19_06_42_568Z-debug.log

The version of "@moneybutton/paymail-client" that I installed is "0.38.4".

Document P2P Transactions

I was originally going to make a pull request that added P2P transaction broadcasting and payment destination support to this library.

But then, after reviewing the source code, I realized that it was already added! It just hasn't been documented yet.

I think that having documentation around P2P Transactions in this library (and P2P Transactions more generally) is important for adoption and scalability. We should really emphasize it to developers, especially new developers building solutions. When scanning no longer becomes practical, having P2P infrastructure in place will ensure that as many services as possible can switch as gracefully as possible.

I'm happy to take the time to document this, update README.md and add inline code docs (and there is at least one typo in the example code I'd like to fix), but it looks like there are already 5 PRs on this library which haven't been merged. I am hesitant to propose new changes if they won't be merged, and I'm not sure if this library is actively maintained.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.