{"id":30620992,"url":"https://github.com/syscoin/syscointx-js","last_synced_at":"2025-08-30T14:17:58.360Z","repository":{"id":40315642,"uuid":"265136820","full_name":"syscoin/syscointx-js","owner":"syscoin","description":"Syscoin raw transaction creation for normal and SPT transactions in Javascript","archived":false,"fork":false,"pushed_at":"2025-08-27T07:48:36.000Z","size":1601,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-08-27T10:50:46.992Z","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/syscoin.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-19T03:47:33.000Z","updated_at":"2025-08-27T07:48:39.000Z","dependencies_parsed_at":"2024-06-21T04:16:53.565Z","dependency_job_id":"590f6fa3-604b-44f1-9319-35f32f5bc341","html_url":"https://github.com/syscoin/syscointx-js","commit_stats":{"total_commits":197,"total_committers":2,"mean_commits":98.5,"dds":0.005076142131979711,"last_synced_commit":"76e4ad6aa11168085c7113ddda68396b14d75420"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/syscoin/syscointx-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscointx-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscointx-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscointx-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscointx-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syscoin","download_url":"https://codeload.github.com/syscoin/syscointx-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscointx-js/sbom","scorecard":{"id":863824,"data":{"date":"2025-08-11","repo":{"name":"github.com/syscoin/syscointx-js","commit":"ec1dec6e4e099e45a8617b1b55368363cbbdec4b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":9,"reason":"11 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T02:08:32.754Z","repository_id":40315642,"created_at":"2025-08-24T02:08:32.754Z","updated_at":"2025-08-24T02:08:32.754Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272592293,"owners_count":24961265,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-08-30T14:17:57.803Z","updated_at":"2025-08-30T14:17:58.355Z","avatar_url":"https://github.com/syscoin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# syscointx-js\n\n[![TRAVIS](https://secure.travis-ci.org/bitcoinjs/coinselect.png)](http://travis-ci.org/syscoin/coinselect)\n[![NPM](http://img.shields.io/npm/v/coinselect.svg)](https://www.npmjs.org/package/coinselect)\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\nAn unspent transaction output (UTXO) selection module for syscoin.\n\n**WARNING:** Value units are in `satoshi`s, **not** Syscoin.\n\n\n## Algorithms\nModule | Algorithm | Re-orders UTXOs?\n-|-|-\n`require('coinselectsyscoin')` | Blackjack, with Accumulative fallback | By Descending Value\n`require('coinselectsyscoin/accumulative')` | Accumulative - accumulates inputs until the target value (+fees) is reached, skipping detrimental inputs | -\n`require('coinselectsyscoin/blackjack')` | Blackjack - accumulates inputs until the target value (+fees) is matched, does not accumulate inputs that go over the target value (within a threshold) | -\n`require('coinselectsyscoin/break')` | Break - breaks the input values into equal denominations of `output` (as provided) | -\n`require('coinselectsyscoin/split')` | Split - splits the input values evenly between all `outputs`, any provided `output` with `.value` remains unchanged | -\n\n\n**Note:** Each algorithm will add a change output if the `input - output - fee` value difference is over a dust threshold.\nThis is calculated independently by `utils.finalize`, irrespective of the algorithm chosen, for the purposes of safety.\n\n**Pro-tip:** if you want to send-all inputs to an output address, `coinselectsyscoin/split` with a partial output (`.address` defined, no `.value`) can be used to send-all, while leaving an appropriate amount for the `fee`. \n\n## Example\n\n``` javascript\nlet coinSelect = require('coinselectsyscoin')\nlet feeRate = 55 // satoshis per byte\nlet utxos = [\n  ...,\n  {\n    txid: '...',\n    vout: 0,\n    ...,\n    value: 10000,\n    // For use with PSBT:\n    // not needed for coinSelect, but will be passed on to inputs later\n    nonWitnessUtxo: Buffer.from('...full raw hex of txId tx...', 'hex'),\n    // OR\n    // if your utxo is a segwit output, you can use witnessUtxo instead\n    witnessUtxo: {\n      script: Buffer.from('... scriptPubkey hex...', 'hex'),\n      value: 10000 // 0.0001 BTC and is the exact same as the value above\n    }\n  }\n]\nlet targets = [\n  ...,\n  {\n    address: '1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm',\n    value: 5000\n  }\n]\n\n// Subtract fee from output example:\n// The fee will be deducted from outputs with subtractFeeFrom in order\nlet targetsWithFeeSubtraction = [\n  {\n    address: '1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm',\n    value: 10000,\n    subtractFeeFrom: true // Fee will be subtracted from this output first\n  }\n]\n\n// Using coinselectsyscoin directly:\nlet { inputs, outputs, fee } = coinSelect(utxos, targets, feeRate)\n\n// the accumulated fee is always returned for analysis\nconsole.log(fee)\n\n// .inputs and .outputs will be undefined if no solution was found\nif (!inputs || !outputs) return\n\nlet psbt = new bitcoin.Psbt()\n\ninputs.forEach(input =\u003e\n  psbt.addInput({\n    hash: input.txId,\n    index: input.vout,\n    nonWitnessUtxo: input.nonWitnessUtxo,\n    // OR (not both)\n    witnessUtxo: input.witnessUtxo,\n  })\n)\noutputs.forEach(output =\u003e {\n  // watch out, outputs may have been added that you need to provide\n  // an output address/script for\n  if (!output.address) {\n    output.address = wallet.getChangeAddress()\n    wallet.nextChangeAddress()\n  }\n\n  psbt.addOutput({\n    address: output.address,\n    value: output.value,\n  })\n})\n\n// Example using syscointx-js with subtractFee:\nconst syscointx = require('syscointx-js')\nconst BN = require('bn.js')\n\n// Create transaction that subtracts fee from output\nconst txOpts = { rbf: true }\nconst utxos = { utxos: [...] } // Your UTXOs\n\n// Single output with subtractFeeFrom\nconst outputsArr = [\n  {\n    address: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq',\n    value: new BN(100000000), // 1 SYS\n    subtractFeeFrom: true // Fee will be deducted from this output\n  }\n]\n\n// Multiple outputs with subtractFeeFrom - fee deducted in order\nconst multipleOutputs = [\n  {\n    address: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq',\n    value: new BN(50000000), // 0.5 SYS\n    subtractFeeFrom: true // Fee deducted from here first\n  },\n  {\n    address: 'bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l',\n    value: new BN(50000000), // 0.5 SYS\n    subtractFeeFrom: true // Only touched if first output can't cover full fee\n  }\n]\n\nconst changeAddress = 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq'\nconst feeRate = new BN(10)\n\nconst result = syscointx.createTransaction(txOpts, utxos, changeAddress, outputsArr, feeRate)\n// Fee is subtracted sequentially from outputs with subtractFeeFrom\n```\n\n\n## License [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscoin%2Fsyscointx-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyscoin%2Fsyscointx-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscoin%2Fsyscointx-js/lists"}