danwebb / uphold-sdk-node Goto Github PK
View Code? Open in Web Editor NEWAn SDK for the Uphold API
An SDK for the Uphold API
I am getting this error: TypeError: Uphold.createPAT is not a function while executing below code when I switched on using PAT creation for authentication :
var Uphold = require('uphold-sdk-node');
Uphold.createPAT('[email protected]', 'XXXX', 'ERNIT PAT desc', false, function(err, res) {
if(err) {
console.log('Error authenticating with Uphold');
}
// add the PAT to the current configs pat property and make authenticated calls
Uphold.addPAT(res.accessToken).user(function(err, user) {
if(err) return customErrorHandler(err);
console.log(user);
});
});
What could be problem here ?
I was trying this sdk out and multiple times came across an unhandled exception on the responseHandler funciton.
For some reason uphold sometimes returns and HTML response instead of a JSON response then the code fails to parse it. I tried to read the HTML but it doesn't say anything really important (I was excepting something from uphold like: hey we are busy now try later).
I'd suggest to wrap line 23 in a try/catch statement and handle the exception as an error.
This is what the returned HTML looks like, if it is of any help.
`
No function for read accounts
I created this PR #6
When POSTing to form a new transaction, the result is not yet a finalized transaction, it's more like a preview, normally used to obtain confirmation from the end-user, and valid for the duration of params.ttl
.
This same endpoint accepts a query string parameter &commit=1
, in which case, the transaction is created and committed in a single step server-side, no two calls necessary. I'd suggest changing createOrCommitTransaction
to merely add &commit=1
to the URL.
I would suggest renaming:
createTransaction
--> prepareTransaction
createOrCommitTransaction
--> createTransaction
So, you'd get the following options:
createTransaction()
prepareTransaction()
and then commitTransaction()
Thoughts?
Currently on api calls that support pagination users can pass a range parameter, this could provide more by reading the content range header like the PHP Uphold SDK does.
Currently uphold-sdk-node only supports the web application flow for authenticating, it should also support Personal Access Tokens (PAT) and Basic Authentication
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.