-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
37 lines (33 loc) · 880 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var rpc = require('onep/rpc');
var fs = require('fs');
rpc.setOptions({
host: 'm2.exosite.com',
path: '/api:v1/rpc/process',
agent: 'node-onep',
https: true,
port: 443,
strictSSL: false //definitely need to get this to work when this is set to true
});
var cik;
document.addEventListener('DOMContentLoaded', function () {
document.getElementById('submit').addEventListener('click', main);
});
function main() {
console.log("main executed");
cik = document.getElementById("cik").value;
rpc.call(cik,
'listing',
['dataport', {}],
function(err, rpcresponse, httpresponse) {
if (err) {
console.log('error: ' + err);
} else {
if (err) {
console.log('error: ' + err);
} else {
console.log('response: ' + rpcresponse); // need to handle using util but not compatible w/ browserify?
}
}
}
);
}