Socket
Book a DemoInstallSign in
Socket

@dash-incubator/dapp-sdk

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@dash-incubator/dapp-sdk

Dash dApp SDK

0.14.13
unpublished
latest
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Dash dApp SDK

Wrapper for dashevo's dash npm package.

DApp projects require the same functions to interact with dash platform contracts, documents, and identities. Instead of sharing function between each project I bundled everything into a set of general utilities that can be used across any Dash DApp.

Usage

MetaMask restricts access to eth wallets to prevent DApps from hijacking the contents of the wallet in use. dapp-sdk provides similar functionality. Once the connection to the Dash network is made all interaction with the connected client is managed through the dapp-sdk package. Without direct access to the Dash client DApps can't request mnemonic or other sensitive information without the users permission.

As of 8/27/2021 this package does not include an extension. An extension or PWA installed on a web enabled device ( likely phone ) will provide the additional software required to bring full MetaMask like functionality to the Dash ecosystem.

Current usage of this package requires initialization of the Dash Client. This would not be required once the extension/PWA is complete.

import { config, user } from '@dash-incubator/dapp-sdk';

const init = async () => {
    config.useLocalStorage();

    // This step can be skipped in dapps once a metamask like
    // service is running for Dash.
    await user.init();

    let wallet = await user.wallet.read();

    // Can be skipped if the DApp doesn't need to register apps, etc.
    if (wallet.balance.confirmed > 0) {
        // Register required apps, etc.
    }
    else {
        setTimeout(init, (1000 * 45));
    }
};

Once wallet is initialized all Dash client interaction is done through the user variable.

user.contract.register(contractDefinitions)

Accepts Dash platform contract schema, returns Dash platform registration output

user.document.delete(documents)

Accepts a list of documents to delete

user.document.read(locator, query)

locator accepts a Dash platform record locator query accepts a Dash platform query object

user.document.save(documents, locator)

documents accepts a list of documents. If document data includes an id field it will attempt to update the document data, otherwise a new document will be created with the supplied data. locator accepts a Dash platform record locator

user.identity.get()

Returns the first identity found for the wallet, otherwise creates a new identity.

user.name.read(name)

Lookup Dash platform name

user.name.register(name)

Registers new Dash platform name

FAQs

Package last updated on 24 Jul 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.