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

deso-protocol

Package Overview
Dependencies
Maintainers
3
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deso-protocol

Client side typescript/javascript SDK for building web3 applications for the [DeSo blockchain](https://docs.deso.org).

  • 1.1.14
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
173
decreased by-19.16%
Maintainers
3
Weekly downloads
 
Created
Source

deso-protocol

Client side typescript/javascript SDK for building web3 applications for the DeSo blockchain.

Installation

npm i deso-protocol

Configuration

import { configure } from 'deso-protocol';

// configure takes all of the same options that the identity
// library's configure method takes: https://github.com/deso-protocol/deso-workspace/tree/main/libs/identity#configuration
// with the addition of the MinFeeRateNanosPerKB value that will be used for all transactions.
configure({
  spendingLimitOptions: {
    GlobalDESOLimit: 1000000000,
    TransactionCountLimitMap: {
      SUBMIT_POST: 4,
    },
  }
  // this is optional, if not passed the default of 1500 will be used.
  MinFeeRateNanosPerKB: 1000,
})

See the identity configuration options for reference.

Usage

Identity: (logging in and out, creating new accounts, etc)

import { identity } from 'deso-protocol';

identity.login();
identity.logout();

See the identity usage docs for reference.

Data: fetching data from a node

import { getUsersStateless, getPostsStateless } from 'deso-protocol';

const users = await getUsersStateless({
  PublicKeysBase58Check: [key1, key2, ...rest],
});

const posts = await getPostsStateless({ NumToFetch: 20 });

See the backend api documentation for reference. See an exhaustive list of the available data fetching functions here.

Transactions: Writing data to the blockchain

The deso-protocol library will handle signing and submitting transactions for confirmation for you. All you need to do is construct them by providing the raw data.

import { submitPost } from 'deso-protocol';

const txInfo = submitPost({
  UpdaterPublicKeyBase58Check: currentUser.publicKey,
  BodyObj: {
    Body: 'My first post on DeSo!',
    ImageURLs: [],
    VideoURLs: [],
  },
});

See the transaction construction api documentation for reference. See an exhaustive list of the available transaction construction functions here

Keywords

FAQs

Package last updated on 14 Apr 2023

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