{"_id":"@dune-network-truffle/artifactor","_rev":"1-d02568d753018ee9a7cd1da6ae48813f","name":"@dune-network-truffle/artifactor","dist-tags":{"latest":"4.2.0-dune.4"},"versions":{"4.2.0-dune.4":{"private":false,"name":"@dune-network-truffle/artifactor","description":"A contract packager for Ethereum and Javascript","license":"MIT","author":{"name":"Tim Coulter"},"repository":{"type":"git","url":"https://github.com/dune-network/truffle/tree/master/packages/artifactor"},"version":"4.2.0-dune.4","main":"dist/index.js","scripts":{"build":"tsc","prepare":"yarn build","test":"mocha"},"dependencies":{"@dune-network-truffle/contract-schema":"^3.2.0-dune.3","fs-extra":"^8.1.0","lodash.assign":"^4.2.0","lodash.merge":"^4.6.2","source-map-support":"^0.5.16"},"devDependencies":{"@dune-network-truffle/contract":"^4.3.0-dune.4","@types/fs-extra":"^8.1.0","@types/lodash.assign":"^4.2.6","@types/lodash.merge":"^4.6.6","@types/node":"^12.6.2","chai":"4.2.0","debug":"^4.1.1","ganache-core":"2.10.2","mocha":"5.2.0","require-nocache":"^1.0.0","temp":"^0.8.3","ts-node":"^8.3.0","typescript":"^3.6.3","web3":"1.2.1"},"publishConfig":{"access":"public"},"gitHead":"99003beee95c2ef1a879e4750012ed276099ce8b","_id":"@dune-network-truffle/artifactor@4.2.0-dune.4","_nodeVersion":"10.15.2","_npmVersion":"lerna/3.19.0/node@v10.15.2+x64 (linux)","dist":{"integrity":"sha512-V5UdbqcJ4SQTa9gjyAWqZmk/SsmnH53qXD2cOlZqejgLbPlDrirIcGyQoQYZ8s5iecjGvI6mW0OJC/KEMvd9yw==","shasum":"bdcc3c628e52e01d1e3c81ab26673855810ddfbe","tarball":"https://registry.npmjs.org/@dune-network-truffle/artifactor/-/artifactor-4.2.0-dune.4.tgz","fileCount":17,"unpackedSize":34655,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenMoWCRA9TVsSAnZWagAA0TYP/3ODoSIt8NmH431w86fV\n3C9cMny+AWrBucFn6G4t//+a7HnUf5EXBnMcbQb7kyLBrVmqscOzNhrtWxb7\nRnr8GBj0jc5d/jZ6eWnG9VXR+pBn66Tspl84bYUly3pKZS3Fcako0E/sGVDg\n/Q4asrfc6vciRewnrvzd96Nw84doof+gLBYbbGbOZrb6uDu4UTuKn3bGoLvy\nt0okxbB1EgB2p3bFdU1tnBPdirlaQVF8Rv7/QSpQb1DGLhKjtaGj6S1LTI4c\nhcqnOkS1DRnvbYm4ityNAI47D2YN2884V1/X2qOV6drTGaM2JCRSwX2o1rzu\nnBKQb5So7hQbnSw6xuCHVYrKnj5II44N9H2BxMLzQRrUZM2dUhtZ3HWGoDCj\nPnMuBivETG2VU/p3XAt7a2iWDiotMfR+8x8gWh0c5Ve6y7z/weuxxf6SWepr\nrJoV6kRuGw+m5U+W1qaGRDmELwX6V1EW7ycnEM9TDMCaeX1IU1TAMJsMKkMd\nPjfveqDZB0TnWc3iDT6d0PoSmQ8ddLcbFyEweTUPs6jTsECmz6GynQYfGKfv\nKp3nJOCAAJfm21mA9J7FM7AYbliC16ofxvHaIXJPNVDzu7N8+6IwHs6r1xIC\nsVxJXoVfKwVP+oGb7lSgVH98Pf5Xc+7BkcUklgn2IuG0hOp2m9gy88NCbYsJ\n6fex\r\n=JJaf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvCSqbi0ulGcM96SKbytHWXRzG9CFIDpeOLE+LuYFgWQIhALBCmrlbrHTt01BIsI8EF6wyQQQGpc7tCukyfp/CQuZQ"}]},"maintainers":[{"name":"lefessan","email":"fabrice.le_fessant@origin-labs.com"}],"_npmUser":{"name":"lefessan","email":"fabrice.le_fessant@origin-labs.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/artifactor_4.2.0-dune.4_1587333654446_0.3091388409871636"},"_hasShrinkwrap":false}},"time":{"created":"2020-04-19T22:00:54.181Z","4.2.0-dune.4":"2020-04-19T22:00:54.596Z","modified":"2022-04-05T06:08:24.157Z"},"maintainers":[{"name":"lefessan","email":"fabrice.le_fessant@origin-labs.com"}],"description":"A contract packager for Ethereum and Javascript","repository":{"type":"git","url":"https://github.com/dune-network/truffle/tree/master/packages/artifactor"},"author":{"name":"Tim Coulter"},"license":"MIT","readme":"# @dune-network-truffle/artifactor\n\nThis package saves contract artifacts into JSON files\n\n```javascript\nconst Artifactor = require(\"@dune-network-truffle/artifactor\");\nconst artifactor = new Artifactor(__dirname);\nartifactor.save({/*...*/}); // => a promise saving MyContract.json to a given destination\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 `.json` files, which can then be included in your project with a simple `require`.\n* Manages library addresses for linked libraries.\n\nThe artifactor can be used with [@dune-network-truffle/contract](https://github.com/dune-network/truffle/tree/develop/packages/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 @dune-network-truffle/artifactor\n```\n\n### Example\n\nHere, we'll generate a `.json` files given a JSON object like [@dune-network-truffle/contract-schema](https://github.com/dune-network/truffle/tree/develop/packages/contract-schema). This will give us a file which we can later `require` into other projects and contexts.\n\n```javascript\nconst Artifactor = require(\"@dune-network-truffle/artifactor\");\nconst artifactor = new Artifactor(__dirname);\n\n// See truffle-schema for more info: https://github.com/dune-network/truffle/tree/develop/packages/contract-schema\nconst contractData = {\n  contractName: \"...\",        // String; optional.\n  abi: ...,                   // Array; required.\n  metadata: \"...\",            // String; optional.\n  bytecode: \"...\",            // String; optional.\n  \"x-some-dependency\": ...    // String, Number, Object, or Array: optional.\n};\n\nartifactor.save(contractData);\n// The file ./MyContract.json now exists, which you can\n// import into your project like any other Javascript file.\n```\n\n# API\n\n#### `artifactor.save(contractData)`\n\nSave contract data as a `.json` file. Returns a Promise.\n\n* `contractData`: Object. Data that represents this contract:\n\n    ```javascript\n    {\n      contractName: \"MyContract\",   // String; optional. Defaults to \"Contract\".\n      abi: ...,                     // Array; required.  Application binary interface.\n      metadata: \"...\",              // String; optional. Contract metadata.\n      bytecode: \"...\",              // String; optional. Contract-creation binary without resolve library links.\n      deployedBytecode: \"...\",      // String; optional. On-chain deployed binary without resolve library links.\n      sourceMap: \"...\",             // String; optional. Source mapping for bytecode.\n      deployedSourceMap: \"...\",     // String; optional. Source mapping for deployedBytecode.\n      source: \"...\",                // String; optional. Uncompiled source code for contract.\n      sourcePath: \"...\",            // String; optional. File path for uncompiled source code.\n      ast: ...,                     // Object; optional. JSON representation of contract source code, as output by compiler.\n      legacyAST: ...,               // Object; optional. Legacy JSON representation of contract source code, as output by compiler.\n      compiler: ...,                // Object; optional. Compiler \"type\" and \"properties\".\n      networks: ...,                // Object; optional. Mapping of network ID keys to network object values (address information, links to other contract instances, and/or contract event logs).\n      schemaVersion: \"...\",         // String; optional. Schema version used by contract object representation.\n      updatedAt: \"...\",             // String; optional. Time contract object representation was generated/most recently updated.\n      devdoc: \"...\",                // String; optional. Developer documentation.\n      userdoc: \"...\",               // String; optional. User documentation.\n      \"x-custom-property\": ...      // String, Number, Object, or Array: optional. Custom property. Keys must be prefixed with \"x-\".\n    }\n    ```\n\n#### `artifactor.saveAll(contracts)`\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 `contractData` objects, as in the `save()` function above:\n\n    ```javascript\n    {\n      \"MyContract\": {\n        \"abi\": ...,\n        \"bytecode\": \"...\"\n      }\n      \"AnotherContract\": {\n        // ...\n      }\n    }\n    ```\n\n### Running Tests\n\n```\n$ npm test\n```\n\n### License\n\nMIT\n","readmeFilename":"README.md"}