synapsepay
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -7,3 +7,12 @@ 'use strict'; | ||
const Transactions = { | ||
list(client, config, callback) { | ||
let url = client.baseUrl + '/trans'; | ||
config.client = client; | ||
APIClient.get(url, config, (err, json) => { | ||
callback(err, json); | ||
}); | ||
}, | ||
get(node, options, callback) { | ||
@@ -10,0 +19,0 @@ const config = { |
{ | ||
"name": "synapsepay", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Node.js Library for SynapsePay API v3.x Rest", | ||
"repository": { | ||
"type" : "git", | ||
"url" : "https://github.com/SynapseFI/SynapseFI-Node.git" | ||
}, | ||
"main": "index.js", | ||
@@ -21,3 +25,3 @@ "scripts": { | ||
"eslint-config-google": "^0.6.0", | ||
"mocha": "^2.3.4", | ||
"mocha": "^5.2.0", | ||
"nock": "^3.3.2" | ||
@@ -24,0 +28,0 @@ }, |
147
samples.md
@@ -453,1 +453,148 @@ | ||
``` | ||
## Subscription API Calls | ||
```javascript | ||
// Imports | ||
const Subscriptions = SynapsePay.Subscriptions; | ||
// Create a Subscription | ||
const createPayload = { | ||
scope: [ | ||
'USERS|POST', | ||
'USER|PATCH', | ||
'NODES|POST', | ||
'NODE|PATCH', | ||
'TRANS|POST', | ||
'TRAN|PATCH' | ||
], | ||
url: 'https://requestb.in/zp216zzp' | ||
}; | ||
let subscription; | ||
Subscriptions.create( | ||
client, | ||
createPayload, | ||
function(err, subscriptionResp) { | ||
// error or subscription object | ||
subscription = subscriptionResp; | ||
} | ||
); | ||
// Get a Subscription | ||
Subscriptions.get( | ||
client, | ||
{ | ||
_id: SUBSCRIPTION_ID | ||
}, | ||
function(err, subscriptionResp) { | ||
// error or subscription object | ||
subscription = subscriptionResp; | ||
} | ||
); | ||
// Get All Subscriptions | ||
let subscriptions; | ||
Subscriptions.get( | ||
client, | ||
null, | ||
function(err, subscriptionsResp) { | ||
// error or subscription object | ||
subscriptions = subscriptionsResp; | ||
} | ||
); | ||
// Update Subscription | ||
const updatePayload = { | ||
scope : 'USERS|POST' | ||
}; | ||
subscription.update( | ||
updatePayload, | ||
function(err, subscriptionResp) { | ||
// error or subscription object | ||
subscription = subscriptionResp; | ||
} | ||
); | ||
``` | ||
## Subnet API Calls | ||
```javascript | ||
// Imports | ||
const Subnets = SynapsePay.Subnets; | ||
// Create a Subnet | ||
const createPayload = { | ||
nickname: "Test AC/RT" | ||
}; | ||
let subnet; | ||
Subnets.create( | ||
node, | ||
createPayload, | ||
function(err, subnetResp) { | ||
// error or subnet object | ||
subnet = subnetResp; | ||
} | ||
); | ||
// Get a Subnet | ||
Subnets.get( | ||
node, | ||
{ | ||
_id: SUBNET_ID | ||
}, | ||
function(err, subnetResp) { | ||
// error or subnet object | ||
subnet = subnetResp; | ||
} | ||
); | ||
// Get All Subnets | ||
let subnets; | ||
Subnets.get( | ||
node, | ||
null, | ||
function(err, subnetsResp) { | ||
// error or subnet object | ||
subnets = subnetsResp; | ||
} | ||
); | ||
// Update Subnet | ||
const updatePayload = { | ||
allowed: 'LOCKED' | ||
}; | ||
subnet.update( | ||
updatePayload, | ||
function(err, subnetResp) { | ||
// error or subnet object | ||
subnet = subnetResp; | ||
} | ||
); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
37230
20
880
1
0