{"_id":"@cognitochain/dharma.js","_rev":"1-89a1ec11ba6b6c57d3139d5e7a6bcef4","name":"@cognitochain/dharma.js","dist-tags":{"latest":"0.1.73"},"versions":{"0.1.73":{"name":"@cognitochain/dharma.js","version":"0.1.73","description":"<img src=\"https://s3-us-west-2.amazonaws.com/dharma-assets/logo+orange.png\"  width=300/>","keywords":[],"main":"dist/dharma.umd.js","module":"dist/lib/src/index.js","typings":"dist/types/src/index.d.ts","author":{"name":"Nadav Hollander","email":"nadav@dharma.io"},"repository":{"type":"git","url":""},"license":"MIT","engines":{"node":">=6.0.0"},"scripts":{"build":"tsc -p tsconfig.prod.json && webpack","chain":"bash scripts/init_chain.sh","commit":"git-cz","commitmsg":"commitlint -e $GIT_PARAMS","docs:build":"./scripts/documentation/generate_typedoc.sh && tsc ./scripts/documentation/typedoc_parser.ts && node ./scripts/documentation/parse_typedoc","docs:upload":"aws s3 cp scripts/documentation/output/documentation.json $S3_URL --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json","lint":"tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'","postpublish":"bash scripts/post_publish.sh","precommit":"lint-staged","prepublishOnly":"npm run build","prettify":"prettier --write {src,__test__,__mocks__}/**/*.ts","report-coverage":"cat ./coverage/lcov.info | coveralls","semantic-release-prepare":"ts-node tools/semantic-release-prepare","semantic-release":"semantic-release pre && npm publish && semantic-release post","start":"rollup -c rollup.config.ts -w","test:prod":"npm run lint && npm run test -- --coverage --no-cache --runInBand","test:watch":"jest --watch --runInBand","test":"jest --runInBand","webpack":"webpack"},"lint-staged":{"{src,__test__,__mocks__}/**/*.ts":["prettier --write"]},"config":{"commitizen":{"path":"node_modules/cz-conventional-changelog"},"validate-commit-msg":{"types":"conventional-commit-types","helpMessage":"Use \"npm run commit\" instead, we use conventional-changelog format :) (https://github.com/commitizen/cz-cli)"}},"jest":{"transform":{".(ts|tsx)":"<rootDir>/node_modules/ts-jest/preprocessor.js"},"testURL":"http://localhost","testRegex":"(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$","moduleFileExtensions":["ts","tsx","js"],"modulePaths":["<rootDir>/"],"coveragePathIgnorePatterns":["/node_modules/","/test/"],"coverageThreshold":{"global":{"branches":40,"functions":55,"lines":55,"statements":55}},"collectCoverage":true},"devDependencies":{"@commitlint/cli":"^6.1.3","@commitlint/config-conventional":"^6.1.3","@types/jest":"^22.0.0","@types/node":"^8.0.0","awesome-typescript-loader":"^3.4.1","babel-cli":"^6.26.0","bn.js":"^4.11.8","colors":"^1.1.2","commitizen":"^2.9.6","coveralls":"^3.0.0","cross-env":"^5.0.1","cz-conventional-changelog":"^2.0.0","ethereumjs-abi":"^0.6.5","ganache-cli":"beta","husky":"^0.14.0","jest":"^22.0.2","lint-staged":"^6.0.0","lodash.camelcase":"^4.3.0","lodash.compact":"^3.0.1","prettier":"^1.10.2","prompt":"^1.0.0","replace-in-file":"^3.0.0-beta.2","rimraf":"^2.6.1","rollup":"^0.53.0","rollup-plugin-commonjs":"^8.0.2","rollup-plugin-json":"^2.3.0","rollup-plugin-node-builtins":"^2.1.2","rollup-plugin-node-globals":"^1.1.0","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-sourcemaps":"^0.4.2","rollup-plugin-typescript2":"^0.9.0","secp256k1":"^3.5.0","semantic-release":"^11.0.2","ts-jest":"^22.0.0","ts-node":"^4.1.0","tslint":"^5.8.0","typedoc":"^0.10.0","typescript":"^2.6.2","web3-fake-provider":"^0.1.0","web3-provider-engine":"^14.0.6","webpack":"^3.11.0"},"dependencies":{"@dharmaprotocol/contracts":"0.1.22","@types/lodash":"^4.14.104","abi-decoder":"git+https://github.com/dharmaprotocol/abi-decoder.git","bignumber.js":"^5.0.0","ethereumjs-util":"^5.1.4","jsonschema":"^1.2.2","lodash.defaults":"^4.2.0","lodash.includes":"^4.3.0","lodash.isfunction":"^3.0.9","lodash.isobject":"^3.0.2","lodash.isundefined":"^3.0.1","lodash.map":"^4.6.0","lodash.omit":"^4.5.0","lodash.pickby":"^4.6.0","lodash.values":"^4.3.0","moment":"^2.20.1","single-line-string":"^0.0.2","tiny-promisify":"^1.0.0","typedoc-plugin-markdown":"^1.0.14","web3":"~0.20.7","web3-typescript-typings":"git+https://github.com/graemecode/web3-typescript-typings.git","web3-utils":"1.0.0-beta.29"},"gitHead":"075828711ed12b648ab9c7794a9b7bf28192203e","_id":"@cognitochain/dharma.js@0.1.73","_npmVersion":"6.4.1","_nodeVersion":"10.14.0","_npmUser":{"name":"vaasuanala","email":"vaasu85@gmail.com"},"dist":{"integrity":"sha512-5dv+0hGZjMiZKEs1SR9FulzD7WAWg1vFBcM672yGgEYt4DxIimNmqwJFW4H6IwSbOa8ao6K4V9xPUO3C0VPd2g==","shasum":"c3e8222347535a9174a3c620567632b8d30e5bbe","tarball":"https://registry.npmjs.org/@cognitochain/dharma.js/-/dharma.js-0.1.73.tgz","fileCount":306,"unpackedSize":37043718,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcFDWWCRA9TVsSAnZWagAAmIYP/2/tDhUfb0niuyMMCDf2\nxUk3edcmJfiTUEwQLbA6AnUzqH5KR9T12p9/yBemrI6R3mF/z2vh59gZ/iJl\ny2B7eOs4CuDNKETaizud8BQK/uD7hWfvrm9u5FNxu7oVZ9U+JxCFyE2WcxCI\nfGtL3B15oWh7ZfP9DV6Z1eZo6n7aRyI7oo+0dWrGhQi16YWeHxYXYRHRrQ7y\nqaCZZbRMSOsm4P81QV0zFvaDSrFhA0Wx/NeaspQImtQ/MM4RnCJq3X1LSb/d\nsi2inyMBidMlt4omFcSTsyMFBbd/qPElIWh1TvMGv3TuD8WmG+DFp1Kch78V\nYsaRJ9i4xeFfE5oW5klRMRrucMdOwtVVCh5lP0FlGfA++qRpC8NZMpjbgJnm\nIzyoN6V+fMZj4J2tnGTZtlCHkpyuTRgkKGcrxQC/dBL9YzLoYtm8grpsNfkj\neFSbkPcWOgv7sW3lTQTfAV6btbfHKdRl+LUQLkfxzeATK01fJjLZKMPzcDzJ\njlV5x7B3pCadIEQ0ELvfWFYzYAPmuAoHmDGcDEZX01rBEm1hxactTBvikxLW\nz6AjjR2RElf2vLzej7a16DVIac1rw7W4p094+PCCBjFy/CMvT0YijKbUh7xu\nH3OsPBAMztaxAVyoBQtGaoepWC7rpU35630D2k41x8BpKfqzpfgLGVAkA1IU\n48hW\r\n=WKJv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJi/zMo8uSJjstMZQ4x5HIIhIJMGpLugSSeaqYDbzFIAIgS4pS0jjMAsZhVALQ6s8s44EzcxGcC2kTkPeHoLOdhUc="}]},"maintainers":[{"name":"vaasuanala","email":"vaasu85@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dharma.js_0.1.73_1544828309330_0.5685242445500369"},"_hasShrinkwrap":false}},"time":{"created":"2018-12-14T22:58:29.156Z","0.1.73":"2018-12-14T22:58:29.525Z","modified":"2022-04-05T00:13:39.139Z"},"maintainers":[{"name":"vaasuanala","email":"vaasu85@gmail.com"}],"description":"<img src=\"https://s3-us-west-2.amazonaws.com/dharma-assets/logo+orange.png\"  width=300/>","keywords":[],"repository":{"type":"git","url":""},"author":{"name":"Nadav Hollander","email":"nadav@dharma.io"},"license":"MIT","readme":"<img src=\"https://s3-us-west-2.amazonaws.com/dharma-assets/logo+orange.png\"  width=300/>\n\n------------\n## Hello, `dharma.js`!\n\n[![CircleCI](https://circleci.com/gh/dharmaprotocol/dharma.js/tree/master.svg?style=svg)](https://circleci.com/gh/dharmaprotocol/dharma.js/tree/master)\n\nThis repository contains the `dharma.js` client application development libraries.  `dharma.js` makes it easy for developers who may not be deeply familiar with smart contract development to interact with the various components of Dharma protocol and build hyper-flexible lending applications.\n\nFor more information, please check out the [Dharma Developer Portal](https://developer.dharma.io).\n\n## Getting Started with Dharma.js\n\n### Installing Dharma.js\n\nAdd Dharma.js to your project using yarn:\n\n```bash\nyarn add @dharmaprotocol/dharma.js\n```\n\nAlternatively, add Dharma.js to your project using npm:\n\n```bash\nnpm install @dharmaprotocol/dharma.js --save\n```\n\n### Importing Dharma.js\n\nInclude Dharma.js in your project code using ES6 style imports (recommended):\n\n```javascript\nimport { Dharma } from \"@dharmaprotocol/dharma.js\";\n```\n\nAlternatively, include Dharma.js in your project code using _require_ syntax:\n\n```javascript\nconst { Dharma } = require(\"@dharmaprotocol/dharma.js\");\n```\n\n### Instantiating Dharma.js\n\nIn order to instantiate Dharma.js, you need to specify a web3 provider.\n\nThe web3 provider can either be instantiated directly, or pulled from the browser's window object.\n\n#### Instantiating the web3 provider directly\n\nYou'll want to instantiate a web3 provider directly if you're:\n\n- running Dharma.js on a backend\n- working with a local blockchain\n\nYou'll first import Dharma and Web3 from the Dharma.js package:\n\n```javascript\nimport { Dharma, Web3 } from \"@dharmaprotocol/dharma.js\";\n```\n\nAssuming you're running a local blockchain on localhost port 8545, you'd specify the provider as follows:\n\n```javascript\nconst host = \"http://localhost:8545\";\nconst provider = new Web3.providers.HttpProvider(host);\n```\n\nYou'd then pass the above provider to the Dharma constructor, using JavaScript's `new` operator to construct an instance of Dharma connected to your local blockchain:\n\n```javascript\nconst dharma = new Dharma(provider);\n```\n\n#### Pulling the web3 provider off the browser's window object\n\nIf the user is interacting with your dApp via a web3 wallet (e.g., MetaMask, Coinbase Wallet, etc.), you can pull the web3 provider from the browser's window object and pass that to the Dharma constructor:\n\n```javascript\nconst provider = window.web3.currentProvider;\n\nconst dharma = new Dharma(provider);\n```\n","readmeFilename":"README.md"}