moneybutton / paymail-client Goto Github PK
View Code? Open in Web Editor NEWJs client to interact with servers using paymail specification.
License: Other
Js client to interact with servers using paymail specification.
License: Other
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.
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="
}
pls add api to get the public address related to paymail not just pubkey
Steps to reproduce:
npm init
(create a new project);npm add @moneybutton/paymail-client
;const { Tx } = require("@moneybutton/paymail-client");
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".
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.