{"_id":"@bancoin/bancoin-transactions","_rev":"3-99a466d11aff89445a68359abc4c2a14","name":"@bancoin/bancoin-transactions","dist-tags":{"latest":"3.24.0"},"versions":{"3.16.3-b":{"name":"@bancoin/bancoin-transactions","version":"3.16.3-b","description":"Build and sign(multi-sign) transactions for Bancoin blockchain.","keywords":["bancoin","crypto","transactions","protocol","binary","cryptography","signature"],"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"preversion":"npm run build","postversion":"npm publish","postpublish":"git push origin head","build":"ts-node build/build.ts && webpack --config webpack.config.js --env","fix-style":"tslint --fix -c tslint.json '{src,test,usage}/**/*{.ts,.tsx}'","test":"jest"},"author":{"name":"bancoinplatform"},"contributors":[{"name":"Sergey B","email":"siemarell@gmail.com"},{"name":"Yuriy Naydenov","email":"ebceu44@gmail.com"}],"license":"MIT","devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^23.3.9","@types/node":"^10.12.3","copy-webpack-plugin":"^4.5.2","jest":"^24.7.1","jsdoc-to-markdown":"^5.0.0","nativescript-typedoc-theme":"0.0.7","ncp":"^2.0.0","preprocess":"^3.1.0","rimraf":"^2.6.2","terser-webpack-plugin":"^1.2.3","ts-jest":"^24.0.2","ts-jsdoc":"^3.0.1","ts-loader":"^5.3.3","ts-node":"^7.0.1","typedoc":"^0.14.2","typedoc-clarity-theme":"^1.1.0","typedoc-plugin-external-module-name":"^2.1.0","typescript":"^3.5.2","typescript-json-schema":"^0.33.0","webpack":"^4.30.0","webpack-cli":"^3.1.0"},"repository":{"type":"git","url":"git+https://github.com/bancoinplatform/bancoin-transactions.git"},"dependencies":{"@bancoin/marshall":"^0.8.0","@bancoin/ts-lib-crypto":"^1.1.1-b","axios":"^0.19.0"},"gitHead":"91eaec935838ce022cc7836ff6f98b61b13db59d","bugs":{"url":"https://github.com/bancoinplatform/bancoin-transactions/issues"},"homepage":"https://github.com/bancoinplatform/bancoin-transactions#readme","_id":"@bancoin/bancoin-transactions@3.16.3-b","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"hbastidas","email":"heberbastidas@gmail.com"},"dist":{"integrity":"sha512-/p9n4XkoapMtdQvgifdOQ9lYnWqbsFZm2g0C/41hsHcCR5PL+Jx1V/kI4XfYNNnYJBeAevVF8bBt5cGVjofY3g==","shasum":"70b59749102ad4da49829a202ccc4e6dce3dd9e3","tarball":"https://registry.npmjs.org/@bancoin/bancoin-transactions/-/bancoin-transactions-3.16.3-b.tgz","fileCount":47,"unpackedSize":101132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdYuZfCRA9TVsSAnZWagAA5vYP/RcLcZwMr71CzCR5+kCo\n9J6Uk9POKKZATl/cMbK7jbodwgbWOdEuSGuMB/Gshw4W+VJKECAEg9DymrC7\nr2dOr1otEudiqUO6vCnRNfk/87bRrp7jhqpgix5mGBO3LzGq/VP4Kpy1yGUd\n1jK+qHdpDGuSsv/HyZvqeknYQdHclNVo2S0x3iJYE++0cP6gVReAeV6zlkTE\nWTAoNsiokTDs5uPX2cAos88qrpPuKxZKxk70OnQwnrXCJDpVN6vxs00yMhQa\nDlkqFb8qTTpiktkfoV5qwy+4NcXPq3qXWyb6vica8oSeq0APziEoUAPpztHw\ndZWi5a+rDIO9LHrMY/lzvR7ni1uw0IexAkCbuNBOPGNzrRt1tm2IdyNxIosn\nledZM+CUxlu+VpJUWjaq/Ckm06oAk61Wi4gFWHfx8fkmy2UiBsYrbfXgV4V0\nYnPM+U+3ZOcUgl0MMG+YJzi6ESbtf/NMWBWBn5UsWc9PpCeU3aH8/fJsBYj/\ngRcSLiHsyhZOtmJcTWrbMVMX11VGUVrFR4Qsr+UwLQG29K2qvmla+UxHrAPc\nk85S4qb2G6pwkteUkA5YGqLL1Oos8wBNkOti7sgEMnbBXk4IwUTmB5xGRCd3\nr2p9pfUClLbKsL0g99cC2QADOKZQsjdM3Sm5hRhPemFrzdF8vZnj7/3MOXMU\nPtv2\r\n=sn9e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHCWuqXClu/hzI7Ks4JxpqsK+jZw6nPnBikyqaqJ8tJvAiB0Kefq5uySqiLBOm/TG8SmpFLiVElYTfC6gc/X0XoDnw=="}]},"maintainers":[{"name":"hbastidas","email":"heberbastidas@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bancoin-transactions_3.16.3-b_1566762590646_0.20927064244957116"},"_hasShrinkwrap":false},"3.24.0":{"name":"@bancoin/bancoin-transactions","version":"3.24.0","description":"Build and sign(multi-sign) transactions for Bancoin blockchain.","keywords":["bancoin","crypto","transactions","protocol","binary","cryptography","signature"],"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"preversion":"npm run build","postversion":"npm publish","postpublish":"git push origin head","build":"ts-node build/build.ts && webpack --config webpack.config.js --env","fix-style":"tslint --fix -c tslint.json '{src,test,usage}/**/*{.ts,.tsx}'","test":"jest"},"author":{"name":"bancoinplatform"},"contributors":[{"name":"Sergey B","email":"siemarell@gmail.com"},{"name":"Yuriy Naydenov","email":"ebceu44@gmail.com"}],"license":"MIT","devDependencies":{"@types/axios":"^0.14.0","@types/jest":"^24.0.18","@types/node":"^12.7.2","copy-webpack-plugin":"^5.0.4","jest":"^24.9.0","jsdoc-to-markdown":"^5.0.0","nativescript-typedoc-theme":"0.0.7","ncp":"^2.0.0","preprocess":"^3.1.0","rimraf":"^3.0.0","terser-webpack-plugin":"^1.4.1","ts-jest":"^24.0.2","ts-jsdoc":"^3.1.1","ts-loader":"^6.0.4","ts-node":"^8.3.0","typedoc":"^0.15.0","typedoc-clarity-theme":"^1.1.0","typedoc-plugin-external-module-name":"^2.1.0","typescript":"^3.5.3","typescript-json-schema":"^0.40.0","webpack":"^4.39.2","webpack-cli":"^3.3.7"},"repository":{"type":"git","url":"git+https://github.com/bancoinplatform/bancoin-transactions.git"},"dependencies":{"@bancoin/marshall":"^0.9.1","@bancoin/ts-lib-crypto":"^1.3.1","axios":"^0.19.0"},"gitHead":"13e9fd7cb756f11f3623ad2a21b5fe5d23249ca1","bugs":{"url":"https://github.com/bancoinplatform/bancoin-transactions/issues"},"homepage":"https://github.com/bancoinplatform/bancoin-transactions#readme","_id":"@bancoin/bancoin-transactions@3.24.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-KKJucbkFpAxLC14UuP6Y/juyVH6FzM7qxeOOus8lnk3hdQ7TjQopLPr2H1caqF3mgvbXJFzAq2p2u5PU5u5zFA==","shasum":"4211018dcc8d0c952a51f6a08b7cc10d44d979a0","tarball":"https://registry.npmjs.org/@bancoin/bancoin-transactions/-/bancoin-transactions-3.24.0.tgz","fileCount":196,"unpackedSize":791511,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd+kNpCRA9TVsSAnZWagAAO0IQAJ8Q2MZPbjNkM637f2Ey\n25s5vpcBMYBBWwQvLI1q2qfy7+EsLS4hajZEeTLyZauzmIos+7Uqc17Ocs93\n8jNMJ8f418fgKi7kaSnT3n79mmFBVLNJc2nRfAUYElw7CjZX9KffepS18KHv\no7WRn+PgBoplSevdTDoV4AdtRkZtiGWaoil2uqP2xAokAo8poTjAtjf3/VFS\njjN69EITu0AtkVTwBjoEUwcuh7+AjrdnAFL1uvkbjF1NM8pgY54JbBp+QBBQ\nkPSBpFw/81j/mD+1v3dYl6QaTRHCWZ8dShj/bNvL1KqaAElTk+Ukb5wXugR3\nmDxKT9qIuwjK2pNDHYuVmPmTCdSXHhP31KdTGQm5q5eIP/OaChjOk4416VUP\n0dEYjB1goEIctrcLtDiAB6681UCPrZ8uHq1la9B0IXkZE1oC427nPhnesuH5\neF/+JMbmBIP9bNQGk54tlUEY6Xc10WlMpRHU0huVNqSQzR2WuBgyAta2iCsc\nQFaQ66XNXSh8nWGgluRIsYgqY0DPVUGRPbGRqBSO/SHWJNb2HQ/NB8kFDLwi\nrTJduV2m1YvcG+Rpx9dF0Abg3D2/jLoJXO9NteJtfqeEtVC5cKSilr2tBaZz\nBhlCWHykI0Mf/byLGHQ8FXT/9AiQwEY4PTs3OU7WdwMoTTNKSItqk6v5K6p/\nXgd+\r\n=nk1T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEaTPEdEQS0po+IwG6M5ddlnRtyyl7/9sDbwlAE6xaUQIgInvjczJSrK3XONz0eq0ef7LBr9mZ/GfYCbdVpDaxrWA="}]},"maintainers":[{"email":"heberbastidas@gmail.com","name":"hbastidas"},{"email":"jose.estevez.prieto@gmail.com","name":"jestevez"}],"_npmUser":{"name":"hbastidas","email":"heberbastidas@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bancoin-transactions_3.24.0_1576682345368_0.7607820728543104"},"_hasShrinkwrap":false}},"time":{"created":"2019-08-25T19:49:50.435Z","3.16.3-b":"2019-08-25T19:49:50.843Z","modified":"2022-04-04T17:40:56.711Z","3.24.0":"2019-12-18T15:19:05.554Z"},"maintainers":[{"email":"heberbastidas@gmail.com","name":"hbastidas"},{"email":"jose.estevez.prieto@gmail.com","name":"jestevez"}],"description":"Build and sign(multi-sign) transactions for Bancoin blockchain.","homepage":"https://github.com/bancoinplatform/bancoin-transactions#readme","keywords":["bancoin","crypto","transactions","protocol","binary","cryptography","signature"],"repository":{"type":"git","url":"git+https://github.com/bancoinplatform/bancoin-transactions.git"},"contributors":[{"name":"Sergey B","email":"siemarell@gmail.com"},{"name":"Yuriy Naydenov","email":"ebceu44@gmail.com"}],"author":{"name":"bancoinplatform"},"bugs":{"url":"https://github.com/bancoinplatform/bancoin-transactions/issues"},"license":"MIT","readme":"# bancoin-transactions  [![npm version](https://badge.fury.io/js/%40bancoin%2Fbancoin-transactions.svg)](https://badge.fury.io/js/%40bancoin%2Fbancoin-transactions)\n\n[![License][license-image]][license-url] ![Coverage badge gree][coverage-badge-green]\n\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/make-coverage-badge.svg\n[coverage-badge-green]:https://img.shields.io/badge/Coverage-98.77%25-brightgreen.svg\n\nUsing this library you can easily create and sign transactions for Bancoin blockchain.\nIt also allows you to multi-sign existing transactions or create them without signature at all.\n\nThis library is a set of transaction constructing functions:\n* [Alias](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#alias)\n* [Issue](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#issue)\n* [Reissue](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#reissue)\n* [Burn](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#burn)\n* [Lease](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#lease)\n* [Cancel lease](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#cancellease)\n* [Transfer](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#transfer)\n* [Mass transfer](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#masstransfer)\n* [Set script](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#setscript)\n* [Data](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#data)\n* [Sponsorship](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#sponsorship)\n* [Set asset script](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#setassetscript)\n* [InvokeScript](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#invokescript)\n* [Order](https://bancoinplatform.github.io/bancoin-transactions/modules/index.html#order)\n\nCheck full documentation on [GitHub Pages](https://bancoinplatform.github.io/bancoin-transactions/index.html).\n\n### Transactions\n\nThe idea is really simple - you create transaction and sign it from a minimal set of required params.\nIf you want to create [Transfer transaction](https://bancoinplatform.github.io/bancoin-transactions/interfaces/itransfertransaction.html) the minimum you need to provide is **amount** and **recipient** as defined in [Transfer params](https://bancoinplatform.github.io/bancoin-transactions/interfaces/itransferparams.html):\n```js\n\nconst { transfer } = require('@bancoin/bancoin-transactions')\nconst seed = 'some example seed phrase'\nconst signedTranserTx = transfer({\n  amount: 1,\n  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',\n  //Timestamp is optional but it was overrided, in case timestamp is not provided it will fallback to Date.now(). You can set any oftional params yourself. go check full docs\n  timestamp: 1536917842558\n}, seed)\n\n// or using alias\n\nconst signedTranserTx = transfer({\n  amount: 1,\n  recipient: 'alias:W:aliasForMyAddress'\n}, seed)\n```\n\nOutput will be a signed transfer transaction:\n```js\n{\n  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',\n  type: 4,\n  version: 2,\n  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',\n  attachment: undefined,\n  feeAssetId: undefined,\n  assetId: undefined,\n  amount: 1,\n  fee: 100000,\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',\n  timestamp: 1536917842558,\n  proofs: [\n    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE'\n  ]\n}\n```\n\nYou can also create transaction, but not sign it:\n```javascript\nconst unsignedTransferTx = transfer({\n  amount: 1,\n  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',\n  //senderPublicKey is required if you omit seed\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq'\n})\n```\n\nNow you are able to POST it to Bancoin API or store for future purpose or you can add another signature from other party:\n```js\nconst otherPartySeed = 'other party seed phrase'\nconst transferSignedWithTwoParties = transfer(signedTranserTx, seed)\n```\n\nSo now there are two proofs:\n```js\n{\n  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',\n  type: 4,\n  version: 2,\n  recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',\n  attachment: undefined,\n  feeAssetId: undefined,\n  assetId: undefined,\n  amount: 1,\n  fee: 100000,\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',\n  timestamp: 1536917842558,\n  proofs: [\n    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE',\n    'CM9emPzpe6Ram7ZxcYax6s7Hkw6698wXCMPSckveFAS2Yh9vqJpy1X9nL7p4RKgU3UEa8c9RGXfUK6mFFq4dL9z'\n  ]\n}\n```\n\n### Broadcast\nTo send transaction you can use either node [REST API](https://nodo.bancoinnodes.com/api-docs/index.html#!/transactions/broadcast) or [broadcast](https://bancoinplatform.github.io/bancoin-transactions/globals.html#broadcast) helper function:\n```javascript\nconst {broadcast} =  require('@bancoin/bancoin-transactions');\nconst nodeUrl = 'https://nodo.bancoinnodes.com';\n\nbroadcast(signedTx, nodeUrl).then(resp => console.log(resp))\n```\nYou can send tx to any bancoin node you like:. E.g.:\n* http://testnet.bancoinnodes.com/ - bancoin TESTNET nodes hosted by Bancoinplatform\n* https://nodo.bancoinnodes.com - bancoin MAINNET nodes hosted by Bancoinplatform\n#### Important!!!\nMost transactions require chainId as parameter, e.g: [IBurnParams](https://bancoinplatform.github.io/bancoin-transactions/interfaces/iburnparams.html). By default chainId is 'W', which means MAINNET. To make transaction in TESTNET be sure to pass chainId if it is present in params interface and then send it to TESTNET node\n","readmeFilename":"README.md"}