{"_id":"@acctoken/accjs","_rev":"1-a85cb9e15d5d5d1770f66a9382125c04","name":"@acctoken/accjs","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@acctoken/accjs","version":"1.0.0","description":"Talk to acc API","main":"dist/index.js","scripts":{"prepare":"npm run build","lint":"tslint -c tslint.json -p tsconfig.json","lint-fix":"tslint -c tslint.json -p tsconfig.json --fix","test":"jest src/tests/*accjs*","build":"tsc -p ./tsconfig.json && node scripts/copy-ripe-md.js","build-web":"webpack --config webpack.prod.js && webpack --config webpack.debug.js","build-production":"yarn build && yarn build-web && yarn test","clean":"rm -rf dist","docs-init":"sh .docs/scripts/init.sh","docs-build":"sh .docs/scripts/build.sh","docs-serve":"python -m SimpleHTTPServer","docs-publish":"sh .docs/scripts/publish.sh"},"author":{"name":"acctoken"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ACCToken/accjs.git"},"dependencies":{"accjs-ecc":"^1.0.0","babel-runtime":"6.26.0","text-encoding":"0.7.0"},"devDependencies":{"@blockone/tslint-config-blockone":"3.0.0","@types/jest":"24.0.6","@types/node":"11.9.4","@types/text-encoding":"0.0.35","babel-cli":"6.26.0","babel-plugin-transform-runtime":"6.23.0","babel-preset-env":"1.7.0","babel-preset-stage-1":"6.24.1","jest":"23.5.0","jest-fetch-mock":"2.1.1","json-loader":"0.5.7","mocha":"5.2.0","mochawesome":"3.1.1","ts-jest":"24.0.0","ts-loader":"5.3.3","tslint":"5.12.1","tslint-eslint-rules":"5.4.0","typescript":"3.3.3","webpack":"4.29.5","webpack-cli":"3.2.3"},"jest":{"automock":false,"setupFiles":["./src/tests/setupJest.js"],"moduleFileExtensions":["ts","tsx","js"],"transform":{"^.+\\.(tsx?)$":"ts-jest"},"globals":{"ts-jest":{"tsConfig":"tsconfig.json"}},"testRegex":"(/src/.*(\\.|/)(test|spec))\\.(jsx?|tsx?)$","testEnvironment":"node"},"gitHead":"b593b26f13cdaf80655513d690aefc17bc94046f","bugs":{"url":"https://github.com/ACCToken/accjs/issues"},"homepage":"https://github.com/ACCToken/accjs#readme","_id":"@acctoken/accjs@1.0.0","_nodeVersion":"11.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-1ZQ/mLUBHCGISbu3zd0KoP0kVruK0tIPa+8VZGX8mbuzKFp1b4G4xGDAAkAvvZWsJxG82hkCA5iP3a1C1+j1rQ==","shasum":"5f355eb8b242d52fa664abbfe40bc8ab90638e28","tarball":"https://registry.npmjs.org/@acctoken/accjs/-/accjs-1.0.0.tgz","fileCount":37,"unpackedSize":236183,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdusE+CRA9TVsSAnZWagAAnvQP/16LDgB6FqpIgHgN780N\n2bYXqkhgEGXhrLuDi9x89VDtlSK/YwEVpIr8SNnckbhvuZvdikcJMf0V0pGL\n4p6DSoH2ITqUZX9bYG6uY28Hhey/mCHPaiYJ9HWSmVN3iWqnoS68NXIxpQit\njuD+yJd9edWZBkDUnJqqZLspFBPldsa4M1YpL5VQpfUL+kb/nE+Q686U5Y08\n5ty4QJOqqw2gEFx2xqX9gBOa+nCsGZ2fY52wLH/nreipR57w12J3y+mdfpMa\nquOeCkB4IO9Uj+sYweV9Rhpl3ViEdiaszUexHqZQSVlrPNVCUuonwXN8BA9q\nnGT5FJrMt4Fp7oD6eL0p0cDDwfd5pETBBLnKZsYXpVP2ytV+rRSDKFnLe9+D\nf6h3rksY7uIhfdQSCMMUuDenNeW8TWh4CwyH2hpNiwc4uBL+pg405uReoqH8\nyKdbAvYeXan8wumcFMjI2LMsWlEIrupJpsdpets//zWca5Z5/u2VPPySC7c3\nFREWV9zNM6vBig/7EEUt5L0cfBe2IStlkWI/yoLaeCSmlz7mMwYu0lxD7LHv\n553s+ggZ1hMQLuu9Nfi8gZ8jCdj+/kc35aANH0+TECbNbSQS9sdhN2NzotZO\niDUOFgtto6PXT4gbZr5mAQBhCtfZ9IeiMukSrF6csaQR34Cv24aW0bfC+Px+\noEM3\r\n=B8fT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBIZieMEzn5FL/IRDiImQ8JljB53Ja9IQIW3pVXV0BOgIhAMhcKI37LS0PfyGJ6TQOJ/ufKr/pLzA89TdC20kW1r5f"}]},"maintainers":[{"name":"acctoken","email":"acctoken1234@hotmail.com"}],"_npmUser":{"name":"acctoken","email":"acctoken1234@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/accjs_1.0.0_1572520254170_0.42890533166971356"},"_hasShrinkwrap":false}},"time":{"created":"2019-10-31T11:10:53.939Z","1.0.0":"2019-10-31T11:10:54.351Z","modified":"2022-04-04T11:09:41.670Z"},"maintainers":[{"name":"acctoken","email":"acctoken1234@hotmail.com"}],"description":"Talk to acc API","homepage":"https://github.com/ACCToken/accjs#readme","repository":{"type":"git","url":"git+https://github.com/ACCToken/accjs.git"},"author":{"name":"acctoken"},"bugs":{"url":"https://github.com/ACCToken/accjs/issues"},"license":"MIT","readme":"# accjs ![npm](https://img.shields.io/npm/dw/accjs.svg)\n\nJavascript API for integration with ACC-based blockchains using ACC RPC API.\n\nDocumentation can be found [here](https://eosio.github.io/accjs)\n\n## Installation\n\n### NPM\n\nThe official distribution package can be found at [npm](https://www.npmjs.com/package/accjs).\n\n### Add dependency to your project\n\n`yarn add accjs`\n\n### Browser Distribution\n\nClone this repository locally then run `yarn build-web`.  The browser distribution will be located in `dist-web` and can be directly copied into your project repository. The `dist-web` folder contains minified bundles ready for production, along with source mapped versions of the library for debugging.  For full browser usage examples, [see the documentation](https://eosio.github.io/accjs/guides/1.-Browsers.html).\n\n## Import\n\n### ES Modules\n\nImporting using ESM syntax is supported using TypeScript, [webpack](https://webpack.js.org/api/module-methods), or  [Node.js with `--experimental-modules` flag](https://nodejs.org/api/esm.html)\n```js\nimport { Api, JsonRpc, RpcError } from 'accjs';\nimport { JsSignatureProvider } from 'accjs/dist/accjs-jssig';           // development only\n```\n\n### CommonJS\n\nImporting using commonJS syntax is supported by Node.js out of the box.\n```js\nconst { Api, JsonRpc, RpcError } = require('accjs');\nconst { JsSignatureProvider } = require('accjs/dist/accjs-jssig');      // development only\nconst fetch = require('node-fetch');                                    // node only; not needed in browsers\nconst { TextEncoder, TextDecoder } = require('util');                   // node only; native TextEncoder/Decoder\nconst { TextEncoder, TextDecoder } = require('text-encoding');          // React Native, IE11, and Edge Browsers only\n```\n\n## Basic Usage\n\n### Signature Provider\n\nThe Signature Provider holds private keys and is responsible for signing transactions.\n\n***Using the JsSignatureProvider in the browser is not secure and should only be used for development purposes. Use a secure vault outside of the context of the webpage to ensure security when signing transactions in production***\n\n```js\nconst defaultPrivateKey = \"5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr\"; // bob\nconst signatureProvider = new JsSignatureProvider([defaultPrivateKey]);\n```\n\n### JSON-RPC\n\nOpen a connection to JSON-RPC, include `fetch` when on Node.js.\n```js\nconst rpc = new JsonRpc('http://127.0.0.1:8888', { fetch });\n```\n\n### API\n\nInclude textDecoder and textEncoder when using in Node, React Native, IE11 or Edge Browsers.\n```js\nconst api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });\n```\n\n### Sending a transaction\n\n`transact()` is used to sign and push transactions onto the blockchain with an optional configuration object parameter.  This parameter can override the default value of `broadcast: true`, and can be used to fill TAPOS fields given `blocksBehind` and `expireSeconds`.  Given no configuration options, transactions are expected to be unpacked with TAPOS fields (`expiration`, `ref_block_num`, `ref_block_prefix`) and will automatically be broadcast onto the chain.\n\n```js\n(async () => {\n  const result = await api.transact({\n    actions: [{\n      account: 'acc.token',\n      name: 'transfer',\n      authorization: [{\n        actor: 'useraaaaaaaa',\n        permission: 'active',\n      }],\n      data: {\n        from: 'useraaaaaaaa',\n        to: 'useraaaaaaab',\n        quantity: '0.0001 SYS',\n        memo: '',\n      },\n    }]\n  }, {\n    blocksBehind: 3,\n    expireSeconds: 30,\n  });\n  console.dir(result);\n})();\n```\n\n### Error handling\n\nuse `RpcError` for handling RPC Errors\n```js\n...\ntry {\n  const result = await api.transact({\n  ...\n} catch (e) {\n  console.log('\\nCaught exception: ' + e);\n  if (e instanceof RpcError)\n    console.log(JSON.stringify(e.json, null, 2));\n}\n...\n```\n\n## Contributing\n\n[Contributing Guide](./CONTRIBUTING.md)\n\n[Code of Conduct](./CONTRIBUTING.md#conduct)\n\n## License\n\n[MIT](./LICENSE)\n\n## Important\n\nSee LICENSE for copyright and license terms.  Block.one makes its contribution on a voluntary basis as a member of the ACC community and is not responsible for ensuring the overall performance of the software or any related applications.  We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation.  Any test results or performance figures are indicative and will not reflect performance under all conditions.  Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one.  We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.\n","readmeFilename":"README.md"}