Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dsd-client-conn-lib

Package Overview
Dependencies
Maintainers
1
Versions
209
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dsd-client-conn-lib

Provides convenient way to call PDS server API of edzLabs.com's PDS service. Full API reference is located at [app.dase.io](https:*app.dase.io)

  • 1.1.2
  • npm
  • Socket score

Version published
Weekly downloads
40
increased by2.56%
Maintainers
1
Weekly downloads
 
Created
Source

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;
//default host for all is "partner.dase.io"
//but you may specify different hosts and ports like that:
//dsdConn.setCoreServer({ host: "partner.dase.io", port: 5090 });
//dsdConn.setDaseServer({ host: "partner.dase.io", port: 5100 });
//dsdConn.setPdsServer({ host: "partner.dase.io", port: 5200 });
//dsdConn.setKeychainServer({ 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); }
);

Documentation

API reference

Core API methods here

DASE API methods here

PDS API methods here

Keychain API methods here

FAQs

Package last updated on 15 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc