Description
Provides convenient way to call PDS server API of edzLabs.com's PDS service.
Full API reference is located at app.dase.io
Examples
var CONN = require("dsd-client-conn-lib");
var dsdConn = CONN.connClient2;
var dsdCst = CONN.Consts;
dsdConn.setDaseServer({ host: "partner.dase.io", port: 5110 });
function log(title, msg) {
console.log(title, msg ? msg : "");
}
log("sendSilver should success");
dsdConn.getCoreClient().sendSilver({
senderId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
senderPassword: "12345678",
silverAmount: 100,
toUserId: "0xb35ef3e31f2944d252eda42801caf5d890d1d7f9"
}).then(
ok => { log("sendSilver ok: ", ok); },
err => { log("sendSilver err: ", err); }
);
log("sendSilver2 should error");
dsdConn.getDaseClient().sendSilver({
senderId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
senderPassword: "12345678",
toUserId: "0xb35ef3e31f2944d252eda42801caf5d890d1d7f9"
}).then(
ok => { log("sendSilver2 ok: ", ok); },
err => {
log("sendSilver2 err: ", err);
*specify error handlers if necessary
if(err.code === dsdCst.errorCodes.WrongParametersCount.id) {
log("I have wrong parameters count..."+dsdCst.errorCodes.WrongParametersCount.name);
*do something
}
else if(err.code === dsdCst.errorCodes.ServerSideError.id) {
log("I have server error..."+ dsdCst.errorCodes.ServerSideError.name);
*do something
}
}
);
console.log("addDab should success");
dsdConn.getPdsClient().addDab({
ownerId: "0x003e8c791cb39b4cad756b9c25431d6eb3fed85c",
assetUrl: "http:*localhost",
ownerPassword: "12345678",
publicDescription: "new client lib asset"
}).then(
ok => { log("addDab ok: ", ok); },
err => { log("addDab err: ", err); }
);
###########################
Core API methods
###########################
CDASE API methods
###########################
PDS API methods