{"id":13454188,"url":"https://github.com/jnordberg/dsteem","last_synced_at":"2025-04-08T03:09:03.477Z","repository":{"id":22336848,"uuid":"95971475","full_name":"jnordberg/dsteem","owner":"jnordberg","description":"Steem blockchain RPC client","archived":false,"fork":false,"pushed_at":"2023-01-11T11:30:19.000Z","size":8249,"stargazers_count":82,"open_issues_count":47,"forks_count":57,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-03T03:52:44.192Z","etag":null,"topics":["blockchain","rpc-client","steem"],"latest_commit_sha":null,"homepage":"https://jnordberg.github.io/dsteem/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jnordberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-01T15:12:23.000Z","updated_at":"2023-04-26T13:40:56.000Z","dependencies_parsed_at":"2023-01-12T10:15:15.869Z","dependency_job_id":null,"html_url":"https://github.com/jnordberg/dsteem","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnordberg%2Fdsteem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnordberg%2Fdsteem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnordberg%2Fdsteem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jnordberg%2Fdsteem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jnordberg","download_url":"https://codeload.github.com/jnordberg/dsteem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247496569,"owners_count":20948257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","rpc-client","steem"],"created_at":"2024-07-31T08:00:51.703Z","updated_at":"2025-04-08T03:09:03.444Z","avatar_url":"https://github.com/jnordberg.png","language":"TypeScript","funding_links":[],"categories":["SDKs"],"sub_categories":[],"readme":"\n# [dsteem](https://github.com/jnordberg/dsteem) [![Build Status](https://img.shields.io/circleci/project/github/jnordberg/dsteem.svg?style=flat-square)](https://circleci.com/gh/jnordberg/workflows/dsteem) [![Coverage Status](https://img.shields.io/coveralls/jnordberg/dsteem.svg?style=flat-square)](https://coveralls.io/github/jnordberg/dsteem?branch=master) [![Package Version](https://img.shields.io/npm/v/dsteem.svg?style=flat-square)](https://www.npmjs.com/package/dsteem)\n\nRobust [steem blockchain](https://steem.io) client library that runs in both node.js and the browser.\n\n* [Demo](https://comments.steem.vc) ([source](https://github.com/jnordberg/dsteem/tree/master/examples/comment-feed))\n* [Code playground](https://playground.steem.vc)\n* [Documentation](https://jnordberg.github.io/dsteem/)\n* [Bug tracker](https://github.com/jnordberg/dsteem/issues)\n\n---\n\n**note** As of version 0.7.0 WebSocket support has been removed. The only transport provided now is HTTP(2). For most users the only change required is to swap `wss://` to `https://` in the address. If you run your own full node make sure to set the proper [CORS headers](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) if you plan to access it from a browser.\n\n---\n\n\nBrowser compatibility\n---------------------\n\n[![Build Status](https://saucelabs.com/browser-matrix/jnordberg-dsteem.svg)](https://saucelabs.com/open_sauce/user/jnordberg-dsteem)\n\n\nInstallation\n------------\n\n### Via npm\n\nFor node.js or the browser with [browserify](https://github.com/substack/node-browserify) or [webpack](https://github.com/webpack/webpack).\n\n```\nnpm install dsteem\n```\n\n### From cdn or self-hosted script\n\nGrab `dist/dsteem.js` from a [release](https://github.com/jnordberg/dsteem/releases) and include in your html:\n\n```html\n\u003cscript src=\"dsteem.js\"\u003e\u003c/script\u003e\n```\n\nOr from the [unpkg](https://unpkg.com) cdn:\n\n```html\n\u003cscript src=\"https://unpkg.com/dsteem@^0.8.0/dist/dsteem.js\"\u003e\u003c/script\u003e\n```\n\nMake sure to set the version you want when including from the cdn, you can also use `dsteem@latest` but that is not always desirable. See [unpkg.com](https://unpkg.com) for more information.\n\n\nUsage\n-----\n\n### In the browser\n\n```html\n\u003cscript src=\"https://unpkg.com/dsteem@latest/dist/dsteem.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    var client = new dsteem.Client('https://api.steemit.com')\n    client.database.getDiscussions('trending', {tag: 'writing', limit: 1}).then(function(discussions){\n        document.body.innerHTML += '\u003ch1\u003e' + discussions[0].title + '\u003c/h1\u003e'\n        document.body.innerHTML += '\u003ch2\u003eby ' + discussions[0].author + '\u003c/h2\u003e'\n        document.body.innerHTML += '\u003cpre style=\"white-space: pre-wrap\"\u003e' + discussions[0].body + '\u003c/pre\u003e'\n    })\n\u003c/script\u003e\n```\n\nSee the [demo source](https://github.com/jnordberg/dsteem/tree/master/examples/comment-feed) for an example on how to setup a livereloading TypeScript pipeline with [wintersmith](https://github.com/jnordberg/wintersmith) and [browserify](https://github.com/substack/node-browserify).\n\n### In node.js\n\nWith TypeScript:\n\n```typescript\nimport {Client} from 'dsteem'\n\nconst client = new Client('https://api.steemit.com')\n\nfor await (const block of client.blockchain.getBlocks()) {\n    console.log(`New block, id: ${ block.block_id }`)\n}\n```\n\nWith JavaScript:\n\n```javascript\nvar dsteem = require('dsteem')\n\nvar client = new dsteem.Client('https://api.steemit.com')\nvar key = dsteem.PrivateKey.fromLogin('username', 'password', 'posting')\n\nclient.broadcast.vote({\n    voter: 'username',\n    author: 'almost-digital',\n    permlink: 'dsteem-is-the-best',\n    weight: 10000\n}, key).then(function(result){\n   console.log('Included in block: ' + result.block_num)\n}, function(error) {\n   console.error(error)\n})\n```\n\nWith ES2016 (node.js 7+):\n\n```javascript\nconst {Client} = require('dsteem')\n\nconst client = new Client('https://api.steemit.com')\n\nasync function main() {\n    const props = await client.database.getChainProperties()\n    console.log(`Maximum blocksize consensus: ${ props.maximum_block_size } bytes`)\n    client.disconnect()\n}\n\nmain().catch(console.error)\n```\n\nWith node.js streams:\n\n```javascript\nvar dsteem = require('dsteem')\nvar es = require('event-stream') // npm install event-stream\nvar util = require('util')\n\nvar client = new dsteem.Client('https://api.steemit.com')\n\nvar stream = client.blockchain.getBlockStream()\n\nstream.pipe(es.map(function(block, callback) {\n    callback(null, util.inspect(block, {colors: true, depth: null}) + '\\n')\n})).pipe(process.stdout)\n```\n\n\nBundling\n--------\n\nThe easiest way to bundle dsteem (with browserify, webpack etc.) is to just `npm install dsteem` and `require('dsteem')` which will give you well-tested (see browser compatibility matrix above) pre-bundled code guaranteed to JustWork™. However, that is not always desirable since it will not allow your bundler to de-duplicate any shared dependencies dsteem and your app might have.\n\nTo allow for deduplication you can `require('dsteem/lib/index-browser')`, or if you plan to provide your own polyfills: `require('dsteem/lib/index')`. See `src/index-browser.ts` for a list of polyfills expected.\n\n---\n\n*Share and Enjoy!*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnordberg%2Fdsteem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjnordberg%2Fdsteem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjnordberg%2Fdsteem/lists"}