{"bugs":{"url":"https://github.com/trufflesuite/truffle-artifactor/issues"},"dist":{"shasum":"a2f87b375335190f50c6c075b29270f80e46e80a","tarball":"https://registry.npmjs.org/truffle-artifactor/-/truffle-artifactor-3.0.9.tgz","fileCount":10,"integrity":"sha512-EutPyqWya2B5Gc7nOJf6DkDKyYIsjIwMA0gHvasZ5Fb9LYaI3mEB/FS3yNHQTtuPRL7nedI39+D4zu/yyDZyHw==","signatures":[{"sig":"MEUCIQCo6ef0N0K3buuL6n7QcX5kAzvUxV6hU2w2fovUGnbljQIgKq61sP3DSIut8NM6PldUmuuan0BTuVZw2jOKW9twpKQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20795,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaBeKCRA9TVsSAnZWagAAU8cP/37YFaYSxB+gPPhedirU\nxEeCAx6Bx5wVuwQSgKiBwxr5wUUuXGzw82KruLFjAsFy4gjGPXgGwdjorThM\n0Whnym0pDeZnFCC8COoFQE3Cr/t5xqUxvNdCqSbLbBS9EzimvKhkMw98Aweo\nZ4PW71qWtr9+cdJACaJweCyQbxwd+AdT0r4fQizNcFIVkRVHHjVqDRj0zekP\nqVikDpVJxyl537/n2TATIL+l1/gChIouNvKBBfQDi9GY6x5aDjsqVeCDTsuZ\niH7KWRbDqU6AoJ+sX8ZCZvBmjH2M/XQ/f6LuLXnNL8keU7AS8gIvHUDySRym\n2DqUIBjLV+FXGbCEeHhZA86nvqj1mz0gMFzYuRAaVtKXTeWo+OsybU+uZD4+\nUekhfw66hLwg5itU7T8IQmBKAVgY3CSV31onoGUNvKMpjH76o3AnegwpEVU7\nFXEjTGVAcctK6C4vOETniWtKy90ykGYXDbn9SnE7BD3dabIUcGLMLlRIditN\n/1veOCcSTXp6RIVVcc3eRR5/LSnGtCglL3rkLVn45q0asxWva/XoWN5AX0VE\nhF1THEM1Ata5qk6grPiXxuyieaCvkD/MFjPJ2r1HgrJmePY7UlSDoFLAUuAF\nXsKUVYRxjMdQ/guL4UZiYGnTPBMMV2JeBH4JHHi7iopXtwNMaMYytuc/r6MZ\neCY9\r\n=lNdk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","name":"truffle-artifactor","author":{"name":"Tim Coulter"},"readme":"# truffle-artifactor (formerly ether-pudding)\n\nThis package saves contract artifacts into into Javascript files that can be `require`'d. i.e.,\n\n```javascript\nvar artifactor = require(\"truffle-artifactor\");\nartifactor.save({/*...*/}, \"./MyContract.sol.js\") // => a promise\n\n// Later...\nvar MyContract = require(\"./MyContract.sol.js\");\nMyContract.setProvider(myWeb3Provider);\nMyContract.deployed().then(function(instance) {\n  return instance.doStuff(); // <-- matches the doStuff() function within MyContract.sol.\n}).then(function(result) {\n  // We just made a transaction, and it's been mined!\n  // We're given transaction hash, logs (events) and receipt for further processing.\n  console.log(result.tx, result.logs, result.receipt);\n});\n```\n\n👏\n\n### Features\n\n* Manages contract ABIs, binaries and deployed addresses, so you don't have to.\n* Packages up build artifacts into `.sol.js` files, which can then be included in your project with a simple `require`.\n* Includes multiple versions of the same contract in a single package, automatically detecting which artifacts to use based on the network version (more on this below).\n* Manages library addresses for linked libraries.\n* Manages events, making them available on a per-transaction basis (no more `event.watch()`!)\n\nThe artifactor uses [truffle-contract](https://github.com/trufflesuite/truffle-contract), which provides features above and beyond `web3`:\n\n* Synchronized transactions for better control flow: transactions won't be considered finished until you're guaranteed they've been mined.\n* Promises. No more callback hell. Works well with `ES6` and `async/await`.\n* Default values for transactions, like `from` address or `gas`.\n* Returning logs, transaction receipt and transaction hash of every synchronized transaction.\n\n### Install\n\n```\n$ npm install truffle-artifactor\n```\n\n### Example\n\nHere, we'll generate a `.sol.js` files given a JSON object like [truffle-schema](https://github.com/trufflesuite/truffle-schema). This will give us a file which we can later `require` into other projects and contexts.\n\n```javascript\nvar artifactor = require(\"truffle-artifactor\");\n\n// See truffle-schema for more info: https://github.com/trufflesuite/truffle-schema\nvar contract_data = {\n  abi: ...,              // Array; required.\n  unlinked_binary: \"...\" // String; optional.\n  address: \"...\"         // String; optional.\n};\n\nartifactor.save(contract_data, \"./MyContract.sol.js\").then(function() {\n  // The file ./MyContract.sol.js now exists, which you can\n  // import into your project like any other Javascript file.\n});\n```\n# API\n\n#### `artifactor.save(options, filename[, extra_options])`\n\nSave contract data as a `.sol.js` file. Returns a Promise.\n\n* `options`: Object. Data that represents this contract:\n\n    ```javascript\n    {\n      contract_name: \"MyContract\",  // String; optional. Defaults to \"Contract\"\n      abi: ...,                     // Array; required.  Application binary interface.\n      unlinked_binary: \"...\",       // String; optional. Binary without resolve library links.\n      address: \"...\",               // String; optional. Deployed address of contract.\n      network_id: \"...\",            // String; optional. ID of network being saved within abstraction.\n      default_network: \"...\"        // String; optional. ID of default network this abstraction should use.\n    }\n    ```\n\n    Note: `save()` will also accept an already `require`'d contract object. i.e.,\n\n    ```javascript\n    var MyContract = require(\"./path/to/MyContract.sol.js\");\n\n    artifactor.save(MyContract, ...).then(...);\n    ```\n\n  In this case, you can use the `extra_options` parameter to specify options that aren't managed by the contract abstraction itself.\n\n* `filename`: Path to save contract file.\n* `extra_options`: Object. Used if you need to specify other options within a separate object, for instance, when a contract abstraction is passed instead of an `options` object.\n\n#### `artifactor.saveAll(contracts, directory, options)`\n\nSave many contracts to the filesystem at once. Returns a Promise.\n\n* `contracts`: Object. Keys are the contract names and the values are `contract_data` objects, as in the `save()` function above:\n\n    ```javascript\n    {\n      \"MyContract\": {\n        \"abi\": ...,\n        \"unlinked_binary\": ...\n      }\n      \"AnotherContract\": {\n        // ...\n      }\n    }\n    ```\n\n* `directory`: String. Destination directory. Files will be saved via `<contract_name>.sol.js` within that directory.\n* `options`: Object. Same options listed in `save()` above.\n\n#### `artifactor.generate(options, networks)`\n\nGenerate the source code that populates the `.sol.js` file. Returns a String.\n\n* `options`: Object. Subset of options listed in the `save()` function above. Expects:\n\n    ```javascript\n  {\n      abi: ...,\n      unlinked_binary: ...\n  }\n  ```\n\n* `networks`: Object. Contains the information about this contract for each network, keyed by the network id.\n\n    ```javascript\n    {\n      \"1\": {        // live network\n        \"address\": ...\n      },\n      \"2\": {        // morden network\n        \"address\": ...\n      },\n      \"1337\": {     // private network\n        \"address\": ...\n      }\n    }\n    ```\n\n### Running Tests\n\n```\n$ npm test\n```\n\n### License\n\nMIT\n","gitHead":"071583e5c3e3ad99c6cc4e8b979d93b48f61c373","license":"MIT","private":false,"scripts":{"test":"mocha"},"_npmUser":{"name":"cruzmolina","email":"cruz.adam.molina@gmail.com"},"homepage":"https://github.com/trufflesuite/truffle-artifactor#readme","deprecated":"WARNING: This package has been renamed to @truffle/artifactor.","repository":{"url":"git+https://github.com/trufflesuite/truffle-artifactor.git","type":"git"},"_npmVersion":"lerna/3.4.3/node@v8.16.1+x64 (darwin)","description":"A contract packager for Ethereum and Javascript","directories":{},"maintainers":[{"name":"cruzmolina","email":"cruz.adam.molina@gmail.com"},{"name":"davidmurdoch","email":"david@davidmurdoch.com"},{"name":"eggplantzzz","email":"pobol234@gmail.com"},{"name":"fainashalts","email":"fainashalts@gmail.com"},{"name":"gnidan","email":"nick@gnidan.org"},{"name":"haltman","email":"harry.j.altman@gmail.com"},{"name":"seesemichaelj","email":"seesemichaelj@gmail.com"},{"name":"tcoulter","email":"tim@timothyjcoulter.com"}],"_nodeVersion":"8.16.1","dependencies":{"async":"2.6.1","debug":"^3.1.0","lodash":"^4.17.12","fs-extra":"6.0.1","truffle-expect":"^0.0.4","truffle-contract":"^3.0.8","truffle-contract-schema":"^2.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"4.1.2","solc":"0.4.26","temp":"^0.8.3","web3":"0.20.6","mocha":"5.2.0","ganache-cli":"6.1.8","require-nocache":"^1.0.0","truffle-blockchain-utils":"^0.0.5"},"_npmOperationalInternal":{"tmp":"tmp/truffle-artifactor_3.0.9_1567102858075_0.9371013261786403","host":"s3://npm-registry-packages"},"_id":"truffle-artifactor@3.0.9","version":"3.0.9"}