{"_id":"@crisog/court-backend-shared","_rev":"1-1182412ef73d70c826a00ab116d9ca43","name":"@crisog/court-backend-shared","dist-tags":{"latest":"0.2.22"},"versions":{"0.2.22":{"name":"@crisog/court-backend-shared","version":"0.2.22","workspaces":{"nohoist":["@aragon/minime","@aragon/court","@aragonone/precedence-campaign-arbitrable"]},"author":{"name":"Aragon One"},"license":"(GPL-3.0-or-later OR AGPL-3.0-or-later)","dependencies":{"@aragon/court":"1.1.0","@aragon/minime":"1.0.0","@aragon/test-helpers":"^2.1.0","@aragon/truffle-config-v5":"^1.0.1","@aragonone/erc20-faucet":"^1.0.0","@aragonone/precedence-campaign-arbitrable":"^1.0.0","@truffle/config":"1.2.7","axios":"^0.19.0","chalk":"^2.4.2","dotenv":"^8.2.0","ethers":"^4.0.46","graphql-request":"^1.8.2","postmark":"^2.5.3","web3-utils":"^1.2.4"},"description":"This repo provides a set of JavaScript components shared by all of the repos contained in this mono-repo.","_id":"@crisog/court-backend-shared@0.2.22","_nodeVersion":"10.22.1","_npmVersion":"6.14.6","dist":{"integrity":"sha512-yoihSBZUqAtcqrHcWMYkFCmye+qUe+94vRNXllVSObMKIUme7Oz3FnslmO163GoqtfOmQeXVXBQ9x8iTFIld+A==","shasum":"a5614c311e9f04370f37d331bbb7542438e54ce0","tarball":"https://registry.npmjs.org/@crisog/court-backend-shared/-/court-backend-shared-0.2.22.tgz","fileCount":22,"unpackedSize":40640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgLUxZCRA9TVsSAnZWagAAZmYP/ikSc7r5PO+YyXR5lxHo\nnIhp4bXSxQfahVNLsWZl3O1jLcRAerON8pxQtUT35A3hkgkD228nTTmqiNXv\nsLY0FJYYdwVedlJ8CR4tSWddT8IkG5ugBpdTK5ExM8+xJ033lwZMh4xIXp5a\ng4Ar+/PuhF+3LRgAPE0llNWH/HI0mHUKvx0TH1SbElkNEXhBbZE4Y0N9BVTS\nCXCo6el86ZSlwYqr01C8yWZkbO0t/ob+hGm7cvEkD+GBM48tbWtt1UQPs9vd\nwyWGqD+iNUmIQAZAUOoRO1gSM5FIh0Jy2RE+mQgV5pZD6LzErxCaKaJ5ru5U\nMY5u6jqa3JSM6Znaiaz4VIZahJ6f2RGfXdqydfGkusXZKNbaf3ZIPqs86lJE\neww77NjVPCXQ/VSW8E+BWS/nKsj4cLVb1Ws0/7kVEbWYYi/Ltni+q5LFuAIR\nGcK9sLCxBynbH3hBC4aqzurfETmd+8wwoNLXRuJhYF0kND9Tv2ii+3ECDRFF\nnXaHk6rA3xwDz62BzgNMtSFQpSl73BnTkvcDF/hImhp/YoN42PJ9Kh9CIdkn\nqX+8MUtA1j9huJdjsN0i2r0QcYKsGkAWdk1EOMhfom8uYgsZ4hbdgNoCxfMl\n1w7hTc7ToGc+ZWcaI2Dpu4nwzdw5USpoELBPlPLdEhfTst8I7OAOxXLlWpa4\n5wyp\r\n=kNo4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDifFvIvJX+peM6dns/w/AQgKL8HVeI9vcmEz3JRZ8FBQIhAKpcCDofHrxUElXPY9Ory8YXLasgaVDSq5p613yf+ytB"}]},"_npmUser":{"name":"crisog","email":"ortega.cpp@gmail.com"},"directories":{},"maintainers":[{"name":"crisog","email":"ortega.cpp@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/court-backend-shared_0.2.22_1613581400563_0.46855736682761795"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-17T17:03:20.519Z","0.2.22":"2021-02-17T17:03:20.753Z","modified":"2022-04-05T01:49:49.790Z"},"maintainers":[{"name":"crisog","email":"ortega.cpp@gmail.com"}],"description":"This repo provides a set of JavaScript components shared by all of the repos contained in this mono-repo.","author":{"name":"Aragon One"},"license":"(GPL-3.0-or-later OR AGPL-3.0-or-later)","readme":"# Court Backend shared\n\nThis repo provides a set of JavaScript components shared by all of the repos contained in this mono-repo.\n\n### Models\n\nIt provides a set of JS classes to encapsulate certain web3 behavior shared among all the repos:\n\n#### Artifacts\n\nThis JS class is in charge of providing JS wrappers for smart contracts (a.k.a. contract artifacts). \nIt provides two flavors of artifacts, one [`dynamic`](./models/artifacts/DynamicArtifacts.js) and another one [`static`](./models/artifacts/StaticArtifacts.js), following the same interface. \nThe difference is that the dynamic one will load the contract schemas lazily, while the static one will load all of them before hand.     \n\n#### Court\n\nThis JS class is intended to be a JS wrapper exposing all the functionality required to interact with an Aragon Court instance. It basically encapsulates all the complexity behind its different smart contracts, exposing a single interface.\nThis class is used by all the projects of the Aragon Court back-office to interact with a court instance.  \n\n#### Environments\n\nThis JS class is in charge of providing all the web3 commonly used components in a web3 application like: a web3 instance, a web3 provider, an artifacts object, the default sender, and some other particular entities like a court instance, a court subgraph, among others.\nIt also provides two different flavors of environments, one for [`browser`](./models/environments/BrowserEnvironment.js) and another one based on [`Truffle configs`](./models/environments/TruffleEnvironment.js). \nThe first one is only used by the back-office frontend app where all the components mentioned above are built based on a browser web3 provider like `Metamask`, while the second one is used by all the other back-office projects (`cli`, `server`, and `services`) where all these components are derived from a Truffle config file. \n\n### Helpers\n\nIt provides the following helper functions:\n- [`email-client`](./helpers/email-client.js): Handles sending emails through Postmark\n- [`gas-price-oracle`](./helpers/gas-price-oracle.js): Get gas price oracle object used to know the current gas prices being paid on each network\n- [`get-wallet-from-pk`](./helpers/get-wallet-from-pk.js): Decode Ethereum address based on a private key\n- [`logger`](./helpers/logger.js): Logger object that provides a friendly interface for fancy logging \n- [`numbers`](./helpers/numbers.js): BigNumber-related helper functions\n- [`sleep`](./helpers/sleep.js): Sleep function to wait a number of seconds \n- [`times`](./helpers/times.js): Time constants for using with `Date()`\n- [`voting`](./helpers/voting.js): Utils related to the CR Voting module of Aragon Court\n","readmeFilename":"README.md"}