{"id":13650526,"url":"https://github.com/blocktrail/blocktrail-sdk-nodejs","last_synced_at":"2025-07-18T17:31:28.526Z","repository":{"id":21617898,"uuid":"24938331","full_name":"blocktrail/blocktrail-sdk-nodejs","owner":"blocktrail","description":"BlockTrail's Developer Friendly NodeJS SDK for the BlockTrail API","archived":false,"fork":false,"pushed_at":"2022-03-09T10:45:58.000Z","size":19715,"stargazers_count":39,"open_issues_count":19,"forks_count":27,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-16T19:13:43.534Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blocktrail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-08T11:50:05.000Z","updated_at":"2021-12-27T18:35:11.000Z","dependencies_parsed_at":"2022-08-21T19:20:53.072Z","dependency_job_id":null,"html_url":"https://github.com/blocktrail/blocktrail-sdk-nodejs","commit_stats":null,"previous_names":[],"tags_count":125,"template":false,"template_full_name":null,"purl":"pkg:github/blocktrail/blocktrail-sdk-nodejs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocktrail%2Fblocktrail-sdk-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocktrail%2Fblocktrail-sdk-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocktrail%2Fblocktrail-sdk-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocktrail%2Fblocktrail-sdk-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blocktrail","download_url":"https://codeload.github.com/blocktrail/blocktrail-sdk-nodejs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blocktrail%2Fblocktrail-sdk-nodejs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265801712,"owners_count":23830458,"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":[],"created_at":"2024-08-02T02:00:37.549Z","updated_at":"2025-07-18T17:31:28.476Z","avatar_url":"https://github.com/blocktrail.png","language":"JavaScript","funding_links":[],"categories":["JavaScript Libraries","Python Frameworks and Tools","awesome Bitcoin"],"sub_categories":["E-Books"],"readme":"BlockTrail NodeJS SDK\n=====================\nThis is the BlockTrail NodeJS SDK. This SDK contains methods for easily interacting with the BlockTrail API.\nBelow are examples to get you started. For additional examples, please see our official documentation\nat https://www.blocktrail.com/api/docs/lang/nodejs\n\n[![Latest Stable Version](https://badge.fury.io/js/blocktrail-sdk.svg)](https://www.npmjs.org/package/blocktrail-sdk)\n[![Build Status](https://travis-ci.org/blocktrail/blocktrail-sdk-nodejs.png?branch=master)](https://travis-ci.org/blocktrail/blocktrail-sdk-nodejs)\n[![Sauce Test Status](https://saucelabs.com/buildstatus/team_blocktrail)](https://saucelabs.com/u/team_blocktrail)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/team_blocktrail.svg)](https://saucelabs.com/u/team_blocktrail)\n\nThe Blocktrail SDK is tested against;  \n - NodeJS:\n   - 0.11\n   - 0.12\n   - 5.11\n   - 6.3.0\n   - 7.1.0\n - Browser:\n   - Google Chrome 48 / latest\n   - Firefox 49 / latest\n   - Safari 10.0 / latest\n   - Edge 14.14393\n   - IE 11.103\n   - Android 4.4\n   - Android 5.0\n   - iPhone OS X 10.10\n\n\nUpgrading from v3.x to v3.4.0\n-----------------------------\nWe've seperated out the backup PDF generator because it contained a lot of dependencies while barely anyone uses it.  \nIf you do want to use it, see the `blocktrail-sdk-backup-generator` package.\n\nUpgrading from v2.x to v3.0.0\n-----------------------------\n**IMPORTANT** `v3.0.0` introduces a new **DEFAULT** wallet encryption, please make sure you upgrade the SDK everywhere you're using it!!\n\nUpgrading from v1.x to v2.0.0\n-----------------------------\n**IMPORTANT** `v2.0.0` has a few BC breaks, please check [docs/CHANGELOG.md](docs/CHANGELOG.md)!!\n\nIMPORTANT! FLOATS ARE EVIL!!\n----------------------------\nAs is best practice with financial data, The API returns all values as an integer, the Bitcoin value in Satoshi's.\n**In Javascript even more than in other languages it's really easy to make mistakes when converting from float to integer etc!**\n\nThe BlockTrail SDK has some easy to use functions to do this for you, we recommend using these\nand we also **strongly** recommend doing all Bitcoin calculation and storing of data in integers\nand only convert to/from Bitcoin float values for displaying it to the user.\n\n```javascript\nvar blocktrail = require('blocktrail-sdk');\n\nconsole.log(\"123456789 Satoshi to BTC: \", blocktrail.toBTC(123456789));\nconsole.log(\"1.23456789 BTC to Satoshi: \", blocktrail.toSatoshi(1.23456789));\n```\n\nA bit more about this can be found [in our documentation](https://dev.btc.com/docs/js).\n\nInstallation\n------------\nYou can install the package through NPM (https://www.npmjs.org/package/blocktrail-sdk).\n```\nnpm install blocktrail-sdk\n```\n\nUsage\n-----\nPlease visit our official documentation at https://dev.btc.com/docs/php#getting-started for the usage.\n\nPromises vs Callbacks\n---------------------\nPersonally we prefer good old callbacks over promises,  \nbut to make everyone happy the SDK functions accept a callback argument and return a (Q)promise object, so you can use whatever you prefer!\n\nSupport and Feedback\n--------------------\nBe sure to visit the BlockTrail API official [documentation website](https://dev.btc.com/docs/js)\nfor additional information about our API.\n\nIf you find a bug, please submit the issue in Github directly.\n[BlockTrail-NodeJS-SDK Issues](https://github.com/blocktrail/blocktrail-sdk-nodejs/issues)\n\nAs always, if you need additional assistance, drop us a note at\n[support@btc.com](mailto:support@btc.com).\n\nUnit Tests\n----------\nUnit Tests are created with Mocha and can be ran with `npm test` (or `mocha`)\n\nWe also run jshint and jscs, these are automatically ran by [travis-ci](https://travis-ci.org/blocktrail/blocktrail-sdk-nodejs) for every commit and pull request.\n```\njshint main.js lib/ test/\n```\n```\njscs main.js lib/ test/\n```\n\nBrowserify\n----------\nThe BlockTrail NodeJS SDK can be browserified to use it in the browser, which we use ourselves for wallet actions from our webapp.  \nIf you want to test or develop on the SDK in the browser you can use `grunt build` (and `grunt watch`) to build the browserify version.\n\nYou need to pull the git submodules before you can build the browserify version:  \n`git submodule update --init --recursive`\n\nFiles in `./build` are:\n\n - `blocktrail-sdk.js` (and `blocktrail-sdk.min.js`) the blocktrailSDK browserified  \n - `jsPDF.js` (and `jsPDF.min.js`) dependancy for generating the backup PDF  \n - `blocktrail-sdk-full.js` (and `blocktrail-sdk-full.min.js`) the blocktrailSDK browserified + jsPDF bundled  \n\nIf you use these browserified versions of our SDK it will be accessible as `window.blocktrailSDK` or plain `blocktrailSDK`.\n\nKnown Supported and Tested Browsers:\n - Android 4.3+ (Use Crosswalk for lower versions if neccesary)\n - iOS6+\n - IE9+\n\nFor the following any modern version will work just fine:\n - Chrome\n - FireFox\n - Safari\n\nWebworker\n---------\nTo defer encryption/decryption/keyderivation to webworkers in the browser it's neccesary to make create the following function in the global scope:\n```\nfunction onLoadWorkerLoadAsmCrypto(worker) {\n    worker.postMessage({\n        method: 'importScripts',\n        script: document.location.protocol + '//' + document.location.host + '/build/asmcrypto.min.js'\n    });\n}\n```\n\nThis will get called as the onLoad of the webworker and will trigger importing the `asmcrypto.min.js`.  \nWe had to seperate `asmcrypto.js` from the main browserify bundle because uglify was killing the ASM.js.\n\nUglify\n------\nIf you're planning to uglify/minify the javascript yourself, make sure to exclude the following variable names from being mangled:  \n`['Buffer', 'BitInteger', 'Point', 'Script', 'ECPubKey', 'ECKey']`\n\nLicense\n-------\nThe BlockTrail NodeJS SDK is released under the terms of the MIT license. See LICENCE.md for more information or see http://opensource.org/licenses/MIT.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocktrail%2Fblocktrail-sdk-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblocktrail%2Fblocktrail-sdk-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblocktrail%2Fblocktrail-sdk-nodejs/lists"}