{"_id":"@bcpros/minimal-xpi-slp-wallet","_rev":"3-6b1fd8e9065a8e22d66a3070622c2519","name":"@bcpros/minimal-xpi-slp-wallet","dist-tags":{"latest":"3.0.12"},"versions":{"3.0.10":{"name":"@bcpros/minimal-xpi-slp-wallet","version":"3.0.10","description":"A minimalist Bitcoin Cash (BCH) wallet npm library, for use in a web apps.","main":"index.js","browser":"dist/minimal-slp-wallet.min.js","types":"types/index.d.ts","scripts":{"start":"node index.js","test":"TEST=unit nyc mocha test/unit/","test:integration":"mocha --timeout 25000 test/integration/","test:temp":"mocha --timeout 25000 -g '#UTXOs' test/integration/","lint":"standard --env mocha --fix","docs":"apidoc -i lib/ -o docs","coverage":"nyc report --reporter=text-lcov | coveralls","coverage:report":"nyc --reporter=html mocha test/unit/ --exit","build":"browserify index.js -p tinyify --s SlpWallet -o dist/minimal-slp-wallet.min.js","build-debug":"browserify index.js -p tinyify --s SlpWallet -o dist/minimal-slp-wallet.min.js","ts:defs":"tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"keywords":["bitcoin","bitcoin cash","wallet","javascript","cryptocurrency","react","front end","client","apidoc","slp","tokens"],"author":{"name":"Chris Troutner","email":"chris.troutner@gmail.com"},"license":"MIT","apidoc":{"title":"minimal-slp-wallet","url":"localhost:5000"},"repository":{"type":"git","url":"git+https://github.com/Permissionless-Software-Foundation/minimal-slp-wallet.git"},"dependencies":{"@abcpros/xpi-js":"^4.0.5","apidoc":"^0.25.0","bch-donation":"^1.1.1","crypto-js":"^4.0.0"},"devDependencies":{"browserify":"^17.0.0","chai":"^4.2.0","coveralls":"^3.1.0","eslint":"7.11.0","eslint-config-prettier":"^6.13.0","eslint-config-standard":"^14.1.1","eslint-plugin-node":"^11.1.0","eslint-plugin-prettier":"^3.1.4","eslint-plugin-standard":"^4.0.1","husky":"^6.0.0","lodash.clonedeep":"^4.5.0","mocha":"^8.2.0","nyc":"^15.1.0","semantic-release":"^17.4.3","sinon":"^9.2.0","standard":"^14.3.4","tinyify":"^3.0.0","typescript":"^4.4.3"},"release":{"publish":[{"path":"@semantic-release/npm","npmPublish":true}]},"husky":{"hooks":{"pre-commit":"npm run lint && npm run build"}},"gitHead":"512d30ea53f0698001cd796ad172b61b4b8f02fc","bugs":{"url":"https://github.com/Permissionless-Software-Foundation/minimal-slp-wallet/issues"},"homepage":"https://github.com/Permissionless-Software-Foundation/minimal-slp-wallet#readme","_id":"@bcpros/minimal-xpi-slp-wallet@3.0.10","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-38Q3Asy1k1nlUrfFUn7gx6q7QXwpoRK+dWHSznGWwHf4myfSe3lZvBJnynMbutPoDJ+2r8CYsnJjDY6jxcR5IA==","shasum":"02a894f3501ff1e19c530d5ea313ad4f8dd1e932","tarball":"https://registry.npmjs.org/@bcpros/minimal-xpi-slp-wallet/-/minimal-xpi-slp-wallet-3.0.10.tgz","fileCount":32,"unpackedSize":1528014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/5T2CRA9TVsSAnZWagAAOc0P+wZS0ybEcwMUxKlTrqg9\n7oCzeP9IkbvP0vD/gS7ZLwidl5LxjR6f29X9DQt7kaD3g9a5bj1Pj+LQf8zs\ngLsfBxraOuNwnDE6pIGuGarNzoOpp2C1luJgl7eMla1C7VCTowUHEsAkR7a+\nleHh8aq5ekMNU87ywVP0hjPiWz6DvSkOIrRI6KLWhHENulh5tsNQOtpqaGfT\nGVsfuqADaf2IYoQLy+J6SfzGOkRWrRPnCMdCP3YIyffJvUV8QP410s9or5gk\nPDiWKd1RWjCl6ajpeS2mDV8IJq2/MoCLmMKej3V9Pw2x1H/feyuoIYCjFJEO\nS5KbSo9zRrQDV8AqZqk+CQwna3z1FN0UMRlS3Lp5Sj8eAFNJcuBSwE4rjQYh\nveLOU0+PTZVkwz2JDfFJU2fvHbTZjIwxlX7DACO5E4DqEAmXZX7SE/fwdxcT\nswaEW7V8JcPVinJroSl6KjqsNWY6uxZORpGr4cp0T5elDjoyaOFp+ERpoIVk\n5Ys/PC7J0eczY2v5IhPojlfdhjly5mSYazuSzk7TEsx8zUnWlOszwL9meNzQ\nbPvzcXTVB59Yx53OmUbjCRXGT31PiWRtwwnrobrUFIwrYCjrfgfaOTuUhswk\nXArYm9G8Tr7T5+z5bf20NIeIPkx+WeKLpShXhVhwjV7AyAc5ItF2P+d0efD0\noMUp\r\n=ji+8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBuPhRkurMsJ8fjtp0FDT+hXVr/788elmBe/0MSl6+iQIgN013x1yzdjzGFz1Djc+9AikFW7fVFb09ZHk/5JmDoBg="}]},"_npmUser":{"name":"ngocviet","email":"vince.tran8x@gmail.com"},"directories":{},"maintainers":[{"name":"ngocviet","email":"vince.tran8x@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minimal-xpi-slp-wallet_3.0.10_1644139766494_0.9505245735695143"},"_hasShrinkwrap":false},"3.0.11":{"name":"@bcpros/minimal-xpi-slp-wallet","version":"3.0.11","description":"A minimalist Bitcoin Cash (BCH) wallet npm library, for use in a web apps.","main":"index.js","module":"dist/minimal-slp-wallet.min.js","types":"types/index.d.ts","scripts":{"start":"node index.js","test":"TEST=unit nyc mocha test/unit/","test:integration":"mocha --timeout 25000 test/integration/","test:temp":"mocha --timeout 25000 -g '#UTXOs' test/integration/","lint":"standard --env mocha --fix","docs":"apidoc -i lib/ -o docs","coverage":"nyc report --reporter=text-lcov | coveralls","coverage:report":"nyc --reporter=html mocha test/unit/ --exit","build":"browserify index.js -p tinyify --s SlpWallet -o dist/minimal-slp-wallet.min.js","build-debug":"browserify index.js --s SlpWallet -o dist/minimal-slp-wallet.min.js","ts:defs":"tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"keywords":["bitcoin","bitcoin cash","wallet","javascript","cryptocurrency","react","front end","client","apidoc","slp","tokens"],"author":{"name":"Chris Troutner","email":"chris.troutner@gmail.com"},"license":"MIT","apidoc":{"title":"minimal-slp-wallet","url":"localhost:5000"},"repository":{"type":"git","url":"git+https://github.com/bcProFoundation/minimal-xpi-slp-wallet.git"},"dependencies":{"@bcpros/xpi-js":"^4.0.10","apidoc":"^0.25.0","bch-donation":"^1.1.1","crypto-js":"^4.0.0"},"devDependencies":{"browserify":"17.0.0","chai":"4.2.0","coveralls":"3.1.0","eslint":"7.17.0","eslint-config-prettier":"7.1.0","eslint-config-standard":"16.0.2","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"3.3.1","eslint-plugin-standard":"4.0.1","husky":"4.3.8","lodash.clonedeep":"4.5.0","mocha":"9.2.1","nyc":"15.1.0","semantic-release":"19.0.3","sinon":"9.2.0","standard":"16.0.4","tinyify":"3.0.0"},"release":{"publish":[{"path":"@semantic-release/npm","npmPublish":true}]},"husky":{"hooks":{"pre-commit":"npm run lint && npm run build"}},"exports":{".":{"import":{"browser":"./dist/minimal-slp-wallet.min.js","node":"./index.js","default":"./index.js"},"require":{"default":"./index.js"}}},"gitHead":"65057838b20a590d110372eaa0b880d828007397","bugs":{"url":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet/issues"},"homepage":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet#readme","_id":"@bcpros/minimal-xpi-slp-wallet@3.0.11","_nodeVersion":"16.13.2","_npmVersion":"8.8.0","dist":{"integrity":"sha512-jS5LE461Ko73mT3bujoAzJ/nCpVB6z1t5RajcRqmkpgbaG+p8NSHCBaMDl0N9dOyhMLwyxDO/cPgpnqBQtH5ZA==","shasum":"2302975911a24a942832bb129d8124b660449850","tarball":"https://registry.npmjs.org/@bcpros/minimal-xpi-slp-wallet/-/minimal-xpi-slp-wallet-3.0.11.tgz","fileCount":32,"unpackedSize":1589370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjzxjYssVorZGpWogNiUfq5tY3EmXV5Bk1XRWBs8YNpgIgKE3yQKSruJN+r8UHzc5S88tcyQ/YiwzP18pgv3ZCKkc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZ2xVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnkBAAkj0z/hiUS1cjTQZEmNapzpmZH/DhjSVcekozbSLKebW4D7o0\r\nAi67+Zxl//cmiTKQwwqH/4JE+dtXUZSE8pmoRXMsuOcSD/DlWql2kp4WMHqb\r\nXtn50TAZ7zmCtyf65oSjLsKW7D4pkzUTZvaz+dknsDWfto7+7rPtxORTdmFt\r\nTOVd4aCULzjSXUTHH0oUmcsJ6cPg0byXXD342bh2iqKnrxQXNfsfzVABtAUK\r\n2Zk6fuixVdN3v8ZnKQ6wHvzHot9MSQScrOoWJ8kV1J9pKoC51ggOQH0xPezp\r\nKwfF7BLhuo/I6KajW8OUL2GxIxpjttlLIC9OdnOLXLBnjWnBCrMxRGVYcsyq\r\nvizww3G1AGQEF3k4vIqpJBQxtOUrd2vaWsOd7EXFJR6ZrLkt8KOfI0O9lcig\r\n3jYWVPKWG5c4foIYEsZOJfVSbvE/i59nHduX9LD66xgZ8SdsyNqnamzKZ6FN\r\niY46Lrujim9gYiovYSN254jkS1Q8bcrdmPXzoWq2dGQShEfLf6UhZijqX8Wb\r\nBYy88noINKbbdU4fotDtGMq/iio3UX6uYoXhx1kQSJcXD79YFeAXVQPNQ7gR\r\nBzZaLZPa6SaUTR1/LHjAdAJojq2ZGAGl/w+edbZvdq4PLDsvLvZVUbNUnGaj\r\nITm27DsFn/ZkZBK6Ty/kxUs6HEzWoOeXLVM=\r\n=6tXf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ngocviet","email":"vince.tran8x@gmail.com"},"directories":{},"maintainers":[{"name":"ngocviet","email":"vince.tran8x@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minimal-xpi-slp-wallet_3.0.11_1667722325563_0.5542691075212625"},"_hasShrinkwrap":false},"3.0.12":{"name":"@bcpros/minimal-xpi-slp-wallet","version":"3.0.12","description":"A minimalist Bitcoin Cash (BCH) wallet npm library, for use in a web apps.","main":"index.js","module":"dist/minimal-slp-wallet.min.js","types":"types/index.d.ts","scripts":{"start":"node index.js","test":"TEST=unit nyc mocha test/unit/","test:integration":"mocha --timeout 25000 test/integration/","test:temp":"mocha --timeout 25000 -g '#UTXOs' test/integration/","lint":"standard --env mocha --fix","docs":"apidoc -i lib/ -o docs","coverage":"nyc report --reporter=text-lcov | coveralls","coverage:report":"nyc --reporter=html mocha test/unit/ --exit","build":"browserify index.js -p tinyify --s SlpWallet -o dist/minimal-slp-wallet.min.js","build-debug":"browserify index.js --s SlpWallet -o dist/minimal-slp-wallet.min.js","ts:defs":"tsc index.js --declaration --allowJs --emitDeclarationOnly --outDir types"},"keywords":["bitcoin","bitcoin cash","wallet","javascript","cryptocurrency","react","front end","client","apidoc","slp","tokens"],"author":{"name":"Chris Troutner","email":"chris.troutner@gmail.com"},"license":"MIT","apidoc":{"title":"minimal-slp-wallet","url":"localhost:5000"},"repository":{"type":"git","url":"git+https://github.com/bcProFoundation/minimal-xpi-slp-wallet.git"},"dependencies":{"@bcpros/xpi-js":"^4.0.11","apidoc":"^0.25.0","bch-donation":"^1.1.1","crypto-js":"^4.0.0"},"devDependencies":{"browserify":"17.0.0","chai":"4.2.0","coveralls":"3.1.0","eslint":"7.17.0","eslint-config-prettier":"7.1.0","eslint-config-standard":"16.0.2","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"3.3.1","eslint-plugin-standard":"4.0.1","husky":"4.3.8","lodash.clonedeep":"4.5.0","mocha":"9.2.1","nyc":"15.1.0","semantic-release":"19.0.3","sinon":"9.2.0","standard":"16.0.4","tinyify":"3.0.0"},"release":{"publish":[{"path":"@semantic-release/npm","npmPublish":true}]},"husky":{"hooks":{"pre-commit":"npm run lint && npm run build"}},"exports":{".":{"import":{"browser":"./dist/minimal-slp-wallet.min.js","node":"./index.js","default":"./index.js"},"require":{"default":"./index.js"}}},"gitHead":"4a43ffaec2c1a8bc81c73497bd318f5490451abf","bugs":{"url":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet/issues"},"homepage":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet#readme","_id":"@bcpros/minimal-xpi-slp-wallet@3.0.12","_nodeVersion":"16.13.2","_npmVersion":"8.8.0","dist":{"integrity":"sha512-GI/7IsJ/r7LOERp61CIhzOQ1YTAtqFT+djxKSjHnu4TMdkbv2l9HY6zd/DIiNZ8TNdp6cIwqTh5qP96vZc1/hw==","shasum":"bfa280c244848f3e72d4471adf19f3e49c928943","tarball":"https://registry.npmjs.org/@bcpros/minimal-xpi-slp-wallet/-/minimal-xpi-slp-wallet-3.0.12.tgz","fileCount":32,"unpackedSize":1589370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJwhQWLgxJs0cG3wrri+sdO1RihA/s6YNwLO9ci0Um8AiEAqXR9P/JUtcIXYJnSRkrI0OBgcduAywODOgYz2tDoreE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZ3cUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr1gg/9Fb4SuBxSOkYXZ2CiuSp2g0u6GTGPaltPEMs33xVlReg3ZVRp\r\nMhVe+dQlCsqVF/PrKy6AdYTc5EE8ZM/kpV9KJ8luDmcc0Y4bMjobBqYrD4Vo\r\nRiA6nKOvhJtPy99rRTgXmgTqry9ahXEd2nThy1m97hwyeLt4OBmGN4+9oczq\r\nHdaV6pqru8U5g8y/AZ1znDgG34dTvlgEZaRFR4vUNitK+7d9S3fQxTnXuwmU\r\nbVJMV4y2AoKyVj1PuNDMGqz+5yj/3Vw3mIlefWMWzG8hs7i1VlgEg8FJ3654\r\n9M2qdK4SicECFQjVB80VWyB7zJfisyA32wuDaj5JjNCM/bIvpBLF78htFWPz\r\nayRIaXA/6fGlaSeWM2uzZMQP53SFHB++mVaYhlSxG5qIpHxczfW4Ji6+xSVP\r\nXpzmwgBFmeo1+m2d/xHwHKKjfuu1ANq29Rvnc4FbUS10cokSD17q5+87rYp7\r\net54/L9CN/VflP1fL3te94OJv+V78f57ylEzgAhcgz7ajeW7wlRPbB/3vzXN\r\nBiUn0SA097rTcvqFZgX8DcQBa0qzmeYnKsHXMJO5w89LYU3QgazP0XLbDwm/\r\nvUVD0YoNYAlUrOydC1vQo994FrVGsMkMfGRY2XVROkP6664wvbNR/Nan2ngn\r\nXdUWGPjt9Z9Dqmhoz3/Z5Cg4rpDr9L077Ss=\r\n=Z056\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ngocviet","email":"vince.tran8x@gmail.com"},"directories":{},"maintainers":[{"name":"ngocviet","email":"vince.tran8x@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/minimal-xpi-slp-wallet_3.0.12_1667725075952_0.9167020261787715"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-06T09:29:26.427Z","3.0.10":"2022-02-06T09:29:26.967Z","modified":"2022-11-06T08:57:56.243Z","3.0.11":"2022-11-06T08:12:05.840Z","3.0.12":"2022-11-06T08:57:56.155Z"},"maintainers":[{"name":"ngocviet","email":"vince.tran8x@gmail.com"}],"description":"A minimalist Bitcoin Cash (BCH) wallet npm library, for use in a web apps.","homepage":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet#readme","keywords":["bitcoin","bitcoin cash","wallet","javascript","cryptocurrency","react","front end","client","apidoc","slp","tokens"],"repository":{"type":"git","url":"git+https://github.com/bcProFoundation/minimal-xpi-slp-wallet.git"},"author":{"name":"Chris Troutner","email":"chris.troutner@gmail.com"},"bugs":{"url":"https://github.com/bcProFoundation/minimal-xpi-slp-wallet/issues"},"license":"MIT","readme":"# minimal-slp-wallet\n\nThis is a minimalist Bitcoin Cash (BCH) wallet for use with front end web apps.\nIt's token aware, unlike the wallet the code is forked from: [minimal-bch-wallet](https://github.com/Permissionless-Software-Foundation/minimal-bch-wallet).\nIt's intended to be used with the [gatsby-ipfs-web-wallet](https://github.com/Permissionless-Software-Foundation/gatsby-ipfs-web-wallet) web-based wallet, and the [bch-js](https://www.npmjs.com/package/@chris.troutner/bch-js) JavaScript library provided by [FullStack.cash](https://fullstack.cash)\n\nThe default derivation path for the wallet keypair is `m/44'/245'/0'/0/0`. This is the BIP44 standard for SLP token-aware BCH wallets.\n\n## Examples\nThe [examples](./examples) directory shows how to write node.js JavaScript apps that use this library to work with BCH:\n\n- [Create a wallet](./examples/create-wallet.js)\n- [Send BCH](./examples/send-bch.js)\n- [List Tokens](./examples/list-tokens.js)\n- [Send Tokens](./examples/send-tokens.js)\n\n## How to use it?\n\n### Import\n#### Add to your HTML scripts\n```js\n<script src=\"https://unpkg.com/minimal-slp-wallet\"></script>\n```\n\n#### Node module\n```bash\nnpm install minimal-slp-wallet --save\n```\n\n```js\n// module import\nimport BchWallet from \"minimal-slp-wallet\";\n\n// nodejs modules\nconst BchWallet = require(\"minimal-slp-wallet\");\n```\n\n### Create new wallets\n```js\nconst bchWallet = new BchWallet();\nawait bchWallet.walletInfoPromise // Wait for wallet to be created.\n\n// 12 words seed phrase for the wallet\nconsole.log(bchWallet.walletInfo.mnemonic);\n\n// cash address derived from the seed (derivation path: m/44'/245'/0'/0/0)\nconsole.log(bchWallet.walletInfo.cashAddress);\n\n// legacy address derived from the seed (derivation path: m/44'/245'/0'/0/0)\nconsole.log(bchWallet.walletInfo.legacyAddress);\n\n// private key for the BCH address derived from the seed (derivation path: m/44'/245'/0'/0/0)\nconsole.log(bchWallet.walletInfo.privateKey);\n```\n\n### Mnemonic encryption\n```js\nconst bchWallet = new BchWallet(null, {\n  password: \"myStrongPassword\"\n});\n\n// 12 words seed phrase for the wallet\nconsole.log(bchWallet.walletInfo.mnemonic);\n\n// encrypted mnemonic\nconsole.log(bchWallet.walletInfo.mnemonicEncrypted);\n\nconst bchWallet2 = new BchWallet(bchWallet.walletInfo.mnemonicEncrypted, {\n  password: \"myStrongPassword\"\n});\n\n// decrypted mnemonic\nconsole.log(bchWallet2.walletInfo.mnemonic);\n```\n\n### Initialize wallet with mnemonic\n```js\n// initialize with 12 words seed phrase for the wallet\nconst bchWallet = new BchWallet(\"minor bench until split suffer shine series bag avoid cruel orient aunt\");\n\n// initialize for specific HD derivation path\nconst bchWallet2 = new BchWallet(\"minor bench until split suffer shine series bag avoid cruel orient aunt\", {\n    HdPath: \"m/44'/245'/0'/1'\"\n});\n```\n\n### Send transactions\nYou can send funds to other BCH wallets. You can distribute funds to N users by simply extending the receiver array.\n```js\nconst bchWallet = new BchWallet();\n\nconst receivers = [\n    {\n        address: \"bitcoincash:qp2rmj8heytjrksxm2xrjs0hncnvl08xwgkweawu9h\",\n        // amount in satoshis, 1 satoshi = 0.00000001 Bitcoin\n        amountSat: 100000\n    }\n];\n\nconst txid = await bchWallet.send(receivers);\n\n// Transaction ID\n// you can then see the transaction in one of the explorers\n// example: `https://explorer.bitcoin.com/bch/tx/${tx.txid}`;\nconsole.log(txid);\n```\n\n### Send Tokens\nYou can send tokens in a similar way:\n```js\n\nconst receiver = {\n  address: \"simpleledger:qpeq7xx5x3a2jfa0x0w8cjqp4v9cm842vgsjqwzvfk\",\n  tokenId: \"a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2\",\n  qty: 1.25\n}\n\nconst txid = await bchWallet.sendTokens(receiver);\n\n// Transaction ID\nconsole.log(txid);\n```\n\n*Note:* Only single token sends are supported at the moment. i.e. One token type\nper receiver per transaction.\n\n\n### Get Wallet Balance\nGets balance (confirmed + unconfirmed) for an BCH address\n\n```js\n// will get a balance for bchWallet.cashAddress\nconst myBalance = await bchWallet.getBalance();\n\n// will get a balance for any address\nconst balanceOfOtherAddress = await bchWallet.getBalance(\"bitcoincash:qp2rmj8heytjrksxm2xrjs0hncnvl08xwgkweawu9h\");\n```\n\n### List Tokens\nList the SLP tokens held by an address.\n```js\n// will get token balance for bchWallet.cashAddress\nconst myBalance = await bchWallet.listTokens();\n\n// will get a balance for any address\nconst balanceOfOtherAddress = await bchWallet.listTokens(\"simpleledger:qpeq7xx5x3a2jfa0x0w8cjqp4v9cm842vgsjqwzvfk\");\n```\n\n### Get Wallet Transaction History\nGet an array of TXIDs of the transactions involving this wallet.\n\n```js\n// will get transaction history for bchWallet.cashAddress\nconst myTransactions = await bchWallet.getTransactions();\n\n// will get transaction history for any address\nconst txHistoryOfOtherAddress = await bchWallet.getTransactions(\"bitcoincash:qp2rmj8heytjrksxm2xrjs0hncnvl08xwgkweawu9h\");\n```\n\n\n### Error Handling\n```js\ntry {\n    tx = await bchWallet.send([\n        { address: \"bitcoincash:qrlhkg4d9z3y88j246a6482xzregxaxnfsagmd2kh3\", amountSat: 1000 }\n    ]);\n} catch (err) {\n    console.error(err);\n\n    if (err.message && err.message.indexOf(\"Insufficient\") > -1) {\n        return alert(\"Insufficient balance on your BCH account.\");\n    }\n\n    return alert(\"Error. Try again later.\");\n}\n```\n\n### Save keys in the browser\nWhile developing BCH apps, remember to never send the private keys / mnemonic / seed phrase to your servers.\n1. Your servers can be hacked\n2. Depending on your jurisdiction you may not have the allowance to manage the funds of your users\n```js\nconst bchWallet1 = new BchWallet();\n\n// save the mnemonic for later\nlocalStorage.setItem(\"BCH_MNEMONIC\", bchWallet1.walletInfo.mnemonic);\n\n// retrieve mnemonic to initialize the wallet\nconst bchWallet2 = new BchWallet(localStorage.getItem(\"BCH_MNEMONIC\"));\n```\n\n\n# Licence\n[MIT](LICENSE.md)\n\n\ntest\n","readmeFilename":"README.md"}