{"id":30620990,"url":"https://github.com/syscoin/syscoinjs-lib","last_synced_at":"2025-08-30T14:17:57.644Z","repository":{"id":40449459,"uuid":"289085617","full_name":"syscoin/syscoinjs-lib","owner":"syscoin","description":"Syscoin JS SDK","archived":false,"fork":false,"pushed_at":"2025-08-28T20:16:56.000Z","size":2770,"stargazers_count":11,"open_issues_count":0,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-28T22:39:44.361Z","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":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-08-20T18:56:06.000Z","updated_at":"2025-08-28T20:16:59.000Z","dependencies_parsed_at":"2024-06-18T22:44:13.281Z","dependency_job_id":"e4ed2c53-3a36-40a5-bc4f-65f6720c562b","html_url":"https://github.com/syscoin/syscoinjs-lib","commit_stats":{"total_commits":319,"total_committers":7,"mean_commits":45.57142857142857,"dds":0.07210031347962387,"last_synced_commit":"017dd313df69a484b60f1c6d6f30b82e990d8bcc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/syscoin/syscoinjs-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscoinjs-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscoinjs-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscoinjs-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscoinjs-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syscoin","download_url":"https://codeload.github.com/syscoin/syscoinjs-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syscoin%2Fsyscoinjs-lib/sbom","scorecard":{"id":863823,"data":{"date":"2025-08-11","repo":{"name":"github.com/syscoin/syscoinjs-lib","commit":"5b9db9e611f1bf03e5ff82fde17ae5da1aa83dac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"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":"Maintained","score":10,"reason":"30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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":"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":"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":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx","Warn: Project is vulnerable to: GHSA-jr5f-v2jv-69x6","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g"],"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:31.844Z","repository_id":40449459,"created_at":"2025-08-24T02:08:31.844Z","updated_at":"2025-08-24T02:08:31.844Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272595218,"owners_count":24961911,"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.125Z","updated_at":"2025-08-30T14:17:57.634Z","avatar_url":"https://github.com/syscoin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SyscoinJS (syscoinjs-lib)\n[![Build Status](https://travis-ci.org/syscoin/syscoinjs-lib.png?branch=master)](https://travis-ci.org/syscoin/syscoinjs-lib)\n[![NPM](https://img.shields.io/npm/v/syscoinjs-lib.svg)](https://www.npmjs.org/package/syscoinjs-lib)\n\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\n\nA javascript Syscoin library for node.js and browsers.\n\nReleased under the terms of the [MIT LICENSE](LICENSE).\n\n## Should I use this in production?\nIf you are thinking of using the *master* branch of this library in production, **stop**.\nMaster is not stable; it is our development branch, and [only tagged releases may be classified as stable](https://github.com/syscoin/syscoinjs-lib/tags).\n\n\n## Can I trust this code?\n\u003e Don't trust. Verify.\n\nWe recommend every user of this library and the [syscoin](https://github.com/syscoin) ecosystem audit and verify any underlying code for its validity and suitability,  including reviewing any and all of your project's dependencies.\n\nMistakes and bugs happen, but with your help in resolving and reporting [issues](https://github.com/syscoin/syscoinjs-lib/issues), together we can produce open source software that is:\n\n- Easy to audit and verify,\n- Tested, with test coverage \u003e95%,\n- Advanced and feature rich,\n- Standardized, using [prettier](https://github.com/prettier/prettier) and Node `Buffer`'s throughout, and\n- Friendly, with a strong and helpful community, ready to answer questions.\n\n\n## Documentation\nPresently,  we do not have any formal documentation other than our [examples](#examples), please [ask for help](https://github.com/syscoin/syscoinjs-lib/issues/new) if our examples aren't enough to guide you.\n\n\n## Installation\n``` bash\nnpm install syscoinjs-lib\n```\n\nTypically we support the [Node Maintenance LTS version](https://github.com/nodejs/Release).\nIf in doubt, see the [.travis.yml](.travis.yml) for what versions are used by our continuous integration tests.\n\n**WARNING**: We presently don't provide any tooling to verify that the release on `npm` matches GitHub.  As such, you should verify anything downloaded by `npm` against your own verified copy.\n\n\n## Usage\nCrypto is hard.\n\nWhen working with private keys, the random number generator is fundamentally one of the most important parts of any software you write.\nFor random number generation, we *default* to the [`randombytes`](https://github.com/crypto-browserify/randombytes) module, which uses [`window.crypto.getRandomValues`](https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues) in the browser, or Node js' [`crypto.randomBytes`](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback), depending on your build system.\nAlthough this default is ~OK, there is no simple way to detect if the underlying RNG provided is good enough, or if it is **catastrophically bad**.\nYou should always verify this yourself to your own standards.\n\nThis library uses [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) with the ECC backend [@bitcoinerlab/secp256k1](https://www.npmjs.com/package/@bitcoinerlab/secp256k1), which uses [RFC6979](https://tools.ietf.org/html/rfc6979) to help prevent `k` re-use and exploitation.\nUnfortunately, this isn't a silver bullet.\nOften, Javascript itself is working against us by bypassing these counter-measures.\n\nProblems in [`Buffer (UInt8Array)`](https://github.com/feross/buffer), for example, can trivially result in **catastrophic fund loss** without any warning.\nIt can do this through undermining your random number generation, accidentally producing a [duplicate `k` value](https://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html), sending Bitcoin to a malformed output script, or any of a million different ways.\nRunning tests in your target environment is important and a recommended step to verify continuously.\n\nFinally, **adhere to best practice**.\nWe are not an authorative source of best practice, but, at the very least:\n\n* [Don't re-use addresses](https://en.bitcoin.it/wiki/Address_reuse).\n* Don't share BIP32 extended public keys ('xpubs'). [They are a liability](https://bitcoin.stackexchange.com/questions/56916/derivation-of-parent-private-key-from-non-hardened-child), and it only takes 1 misplaced private key (or a buggy implementation!) and you are vulnerable to **catastrophic fund loss**.\n* [Don't use `Math.random`](https://security.stackexchange.com/questions/181580/why-is-math-random-not-designed-to-be-cryptographically-secure) - in any way - don't.\n* Enforce that users always verify (manually) a freshly-decoded human-readable version of their intended transaction before broadcast.\n* [Don't *ask* users to generate mnemonics](https://en.bitcoin.it/wiki/Brainwallet#cite_note-1), or 'brain wallets',  humans are terrible random number generators.\n\n\n### Browser\nThe recommended method of using `syscoinjs-lib` in your browser is through [Browserify](https://github.com/substack/node-browserify).\nIf you're familiar with how to use browserify, ignore this and carry on, otherwise, it is recommended to read the tutorial at https://browserify.org/.\n\n**NOTE**: We use Node Maintenance LTS features, if you need strict ES5, use [`--transform babelify`](https://github.com/babel/babelify) in conjunction with your `browserify` step (using an [`es2015`](https://babeljs.io/docs/plugins/preset-es2015/) preset).\n\n**WARNING**: iOS devices have [problems](https://github.com/feross/buffer/issues/136), use atleast [buffer@5.0.5](https://github.com/feross/buffer/pull/155) or greater,  and enforce the test suites (for `Buffer`, and any other dependency) pass before use.\n\n## SyscoinJS exported functions\nThese are the functions available on SyscoinJS library with links to the code which has commenting on the function itself:\n\n- [SyscoinJSLib()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L11)\n- [createAndSignPSBTFromRes()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L62)\n- [sign()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L86)\n- [createTransaction()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L181)\n- [assetNew()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L238)\n- [assetUpdate()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L299)\n- [assetSend()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L351)\n- [assetAllocationSend()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L406)\n- [assetAllocationBurn()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L454)\n- [assetAllocationMint()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L512)\n- [syscoinBurnToAssetAllocation()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L5832)\n\nThese are some supporting functions used to support the library like working with backend providers (Blockbook) and sanitizing data from the providers:\n\n- [fetchBackendAsset()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L70)\n- [fetchBackendUTXOS()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L90)\n- [fetchBackendAccount()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L116)\n- [sendRawTransaction()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L150)\n- [fetchBackendRawTx()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L172)\n- [buildEthProof()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L190)\n- [sanitizeBlockbookUTXOs()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L277)\n\nThese are the HDSigner exported functions, HDSigner is used to manage creating addresses and sign transactions internally using your XPUB (HD wallets). BIP44/BIP84 are supported. P2WPKH, P2WSH, P2PKH, P2SH:\n\n- [HDSigner()()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L378)\n- [getMasterFingerprint()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L410)\n- [deriveAccount()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L419)\n- [setAccountIndex()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L432)\n- [restore()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L443)\n- [backup()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L473)\n- [getNewChangeAddress()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L487)\n- [getNewReceivingAddress()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L507)\n- [createAccount()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L526)\n- [getAccountXpub()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L541)\n- [createPSBTFromRes()](https://github.com/syscoin/syscoinjs-lib/blob/master/index.js#L142)\n- [setLatestIndexesFromXPubTokens()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L549)\n- [createKeypair()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L576)\n- [getAddressFromKeypair()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L585)\n- [getAddressFromPubKey()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L598)\n- [deriveKeypair()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L611)\n- [derivePubKey()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L624)\n- [getRootNode()](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L636)\n\n\n## Examples\nIf you are looking to generate addresses, use WIFs or anything specific around crafting or doing blockchainy things not related to transaction creation, you may use [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) and use the Syscoin network parameters (see [utils.js](https://github.com/syscoin/syscoinjs-lib/blob/master/utils.js#L10) for the exported syscoinNetworks parameters).\n\nThe below examples are implemented as example tests, they should be very easy to understand.\nOtherwise, pull requests are appreciated.\n\n- [Create standard Syscoin transaction](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L10)\n- [Create new SPT](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L34)\n- [Updating SPT](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L58)\n- [Distributing SPT](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L82)\n- [Sending SPT](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L108)\n- [Burning SYSX SPT for Syscoin](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L135)\n- [Burning SYS for SYSX SPT](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L164)\n- [Burning SPT for SysEtheruem bridge](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L193)\n- [Minting SPT from SysEthereum bridge (custom proof)](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L221)\n- [Minting SPT from SysEthereum bridge (automated with txid)](https://github.com/syscoin/syscoinjs-lib-examples/blob/master/index.js#L262)\n\nIf you have a use case that you feel could be listed here, please [ask for it](https://github.com/syscoin/syscoinjs-lib/issues/new)!\n\n### New Features\n\n#### Subtract Fee From Output\n\nThe `createTransaction` method now supports the `subtractFeeFrom` option in outputs. This allows you to subtract the transaction fee from specific outputs instead of requiring additional inputs for fees.\n\n```javascript\nconst outputs = [\n  {\n    address: 'sys1q6f2053q2fnlqpxrwrrqpkhnutwemu984p4vjzm',\n    value: new BN(100000000), // 1 SYS\n    subtractFeeFrom: true // Fee will be deducted from this output\n  }\n];\n\n// Fee is automatically subtracted from outputs marked with subtractFeeFrom\nconst result = await syscoinjs.createTransaction(txOpts, changeAddress, outputs, feeRate);\n```\n\nWhen using multiple outputs with `subtractFeeFrom`, the fee is deducted sequentially:\n\n```javascript\nconst outputs = [\n  {\n    address: 'sys1q6f2053q2fnlqpxrwrrqpkhnutwemu984p4vjzm',\n    value: new BN(50000000), // 0.5 SYS\n    subtractFeeFrom: true // Fee deducted from here first\n  },\n  {\n    address: 'sys1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l',\n    value: new BN(50000000), // 0.5 SYS\n    subtractFeeFrom: true // Only used if first output can't cover full fee\n  }\n];\n```\n\n#### Enhanced Error Handling\n\nAll transaction creation methods now provide better error handling with structured error objects containing:\n\n- **error**: Boolean indicating an error occurred\n- **code**: Error code (e.g., 'INVALID_MEMO', 'INSUFFICIENT_FUNDS', etc.)\n- **message**: Human-readable error message\n- **fee**: Fee information when available\n- **remainingFee**: Remaining fee for subtractFeeFrom errors\n- **shortfall**: Amount short for insufficient funds errors\n- **details**: Additional error details when available\n\n##### Error Codes\n\n- **INSUFFICIENT_FUNDS**: Not enough funds to complete the transaction\n- **INVALID_MEMO**: Memo field validation errors\n- **INVALID_BLOB**: Blob data validation errors for PoDA transactions\n- **INVALID_OUTPUT_COUNT**: When asset allocation outputs exceed limits\n- **INVALID_ASSET_ALLOCATION**: Asset allocation validation errors\n- **INVALID_PARENT_NODES**: SPV proof validation errors\n- **INVALID_TX_VALUE**: Transaction value validation errors\n- **INVALID_RECEIPT_VALUE**: Receipt validation errors\n- **TRANSACTION_CREATION_FAILED**: Generic failure during transaction creation\n\nExample error handling:\n\n```javascript\ntry {\n  const result = await syscoinjs.createTransaction(txOpts, changeAddress, outputs, feeRate);\n  console.log('Transaction created successfully');\n  console.log('Fee spent:', result.fee);\n} catch (error) {\n  console.error('Transaction creation failed:', error.message);\n  \n  // Access structured error data\n  if (error.code === 'INSUFFICIENT_FUNDS' \u0026\u0026 error.shortfall) {\n    console.error('Short by:', error.shortfall, 'satoshis');\n  }\n  \n  if (error.remainingFee) {\n    console.error('Remaining fee that could not be deducted:', error.remainingFee);\n  }\n}\n```\n\n#### Return Values\n\nAll transaction creation methods now return an object containing:\n\n- **psbt**: The created/signed PSBT object\n- **fee**: The transaction fee in satoshis\n\nExample:\n\n```javascript\nconst result = await syscoinjs.createTransaction(txOpts, changeAddress, outputs, feeRate);\nconsole.log('PSBT:', result.psbt);\nconsole.log('Transaction fee:', result.fee, 'satoshis');\n```\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n\n### Running the test suite\n\n``` bash\nnpm test\nnpm run-script coverage\n```\n\n## Complementing Libraries\n\nThis library consumes [syscointx-js](https://github.com/syscoin/syscointx-js) for raw transaction serializing and deserializing, that library consumes [coinselectsyscoin](https://github.com/syscoin/coinselectsyscoin) for the UTXO selection and transaction funding algorithms. Other supporting libraries are:\n\n- [bn.js](https://github.com/indutny/bn.js/) - BigNum in pure javascript.\n- [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) - A javascript Bitcoin library for node.js and browsers. Configurable with Syscoin network settings to work with Syscoin addresses and message signing.\n- [bitcoin-ops](https://github.com/bitcoinjs/bitcoin-ops) - A javascript Bitcoin OP code library for referencing script OP codes for Bitcoin's script\n- [varuint-bitcoin](https://github.com/bitcoinjs/varuint-bitcoin) - encode/decode number as bitcoin variable length integer\n- [BIP84](https://github.com/Anderson-Juhasc/bip84) - P2WPKH/P2WSH HD wallet derivation library for BECH32 addresses\n- [axios](https://github.com/axios/axios) - Promise based HTTP client for the browser and node.js. Used for backend communication with a Blockbook API\n- [eth-object](https://github.com/zmitton/eth-object) - Ethereum Trie / LevelDB data from hex, buffers and rpc.\n- [eth-proof](https://github.com/zmitton/eth-proof) - Generalized merkle-patricia-proof module that supports ethereum state proofs. Used for Eth SPV proofs.\n- [rlp](https://github.com/ethereumjs/rlp) - Recursive Length Prefix Encoding for node.js.\n- [web3](https://github.com/ethereum/web3.js/) - Ethereum JavaScript API which connects to the Generic JSON-RPC spec.\n\n## LICENSE [MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscoin%2Fsyscoinjs-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyscoin%2Fsyscoinjs-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyscoin%2Fsyscoinjs-lib/lists"}