{"_id":"@agreewe/quickwork-sdk","_rev":"1-c2a98ccf4f907eea55251e4b5a84d4b3","name":"@agreewe/quickwork-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@agreewe/quickwork-sdk","version":"1.0.0","description":"Quickwork SDK to allow TS applications to interact with the Quickwork Smart Contract","repository":{"type":"git","url":"git+https://github.com/AgreeWe/QuickWork.git"},"publishConfig":{"access":"public"},"main":"dist/lib/index.js","types":"dist/lib/index.d.ts","exports":{".":"./dist/lib/index.js"},"scripts":{"build":"tsc --project tsconfig.json","watch":"tsc --watch --project tsconfig.json","format":"prettier --write \"src/**/*.{ts,tsx}\"","precommit":"yarn format"},"type":"commonjs","author":{"name":"Yong Ming Yang"},"license":"ISC","devDependencies":{"@types/jest":"^29.2.3","ethers":"^5.7.2","typescript":"^4.9.3"},"dependencies":{"@types/jest":"^29.2.3","ethers":"^5.7.2","typescript":"^4.9.3"},"gitHead":"58d86db5b8b0bc2a483c1371d678976704cbee41","bugs":{"url":"https://github.com/AgreeWe/QuickWork/issues"},"homepage":"https://github.com/AgreeWe/QuickWork#readme","_id":"@agreewe/quickwork-sdk@1.0.0","_nodeVersion":"16.10.0","_npmVersion":"8.12.1","dist":{"integrity":"sha512-YCLTp87m6taxkETaZ/xtSZMhJVulihejyS2MHOk3e1i8xYBGcYP88PsEh8tkLZY6LVpWc6gj18bOpZZfxUF6yw==","shasum":"e3c25bc7bde092365d106c1add1ead8604233c5e","tarball":"https://registry.npmjs.org/@agreewe/quickwork-sdk/-/quickwork-sdk-1.0.0.tgz","fileCount":6,"unpackedSize":1509141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyvUfq9IJKqTmSEKEA3DtLCj1lCCu7mqydwmOrsj6riAiBIYcEyl95trjO6yLN3ZfxxsGLtgwlG4nQbWBh4vBlr9A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiS5ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmon3A//avl2EK+R24TOcW584NJ23VQZBWdYI6KWYkr+wQO0yBzkYIjB\r\niLL65VbFf1XYleMHRezHXAXL10R9gzsKuwUwLAl/PvtMr9lmoC7WwjRoUXSt\r\nPSb5xe3s50NaiQy6D4aVpJMDIsqrcd3+EKvyNgh+ySiefVsppjEMMRff4OwT\r\n4KutP5LOdNVogve1kIAPgxqKnaLhlhHapFgGuJEjTouDyMrrTkMqbj+FSoAC\r\nsnM0CoHRycbqjAQL8Sr8o2mLXwAmU6lnzLBsWfRfzWx87MaHmy1WX/a9iFzX\r\nN+H969HJFT/5XMYUUonwdBz6/pjkD0LGzIVxlDw3UU7VXJ1qu3+yAkYEyZA8\r\nut9YeSgL6hrcxaJHHXs6oA3CWJAeZyQ7jNeAImhQ7v3tCdfJ5ypyCSfZniec\r\nyn4welcQ6RsFTqeHhsVKeZAcSlhFPEJO0em0LnNAxl66H56KTlG2Vd6HDjcZ\r\nICqz9bdNU3cXnKwV5s2BtbPaeC0ABl6lTpitttCE17CNQ0oVs3Tv5CHWCGHj\r\nN9Fy6gA8Auam0mt6UR62F8Ua3QdaAqLyGcVGi/6zLaPON45Sv52sVHpbu1gD\r\nLahnhtLNEUyBNUrVddyQB17voXtNEOz0pvB5bZR5Hc8wES5L6YGNpb/slLD7\r\nUNo3WpQ/iTisaJKvszCOlOswknkEfFic9E4=\r\n=5LVg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yongmingyang","email":"yongmingyang1998@gmail.com"},"directories":{},"maintainers":[{"name":"girish979","email":"girishkreddy@gmail.com"},{"name":"yongmingyang","email":"yongmingyang1998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quickwork-sdk_1.0.0_1669934681147_0.6181798350158267"},"_hasShrinkwrap":false},"1.0.1":{"name":"@agreewe/quickwork-sdk","version":"1.0.1","description":"Quickwork SDK to allow TS applications to interact with the Quickwork Smart Contract","repository":{"type":"git","url":"git+https://github.com/AgreeWe/QuickWork.git"},"publishConfig":{"access":"public"},"main":"dist/lib/index.js","types":"dist/lib/index.d.ts","exports":{".":"./dist/lib/index.js"},"scripts":{"build":"tsc --project tsconfig.json","watch":"tsc --watch --project tsconfig.json","format":"prettier --write \"src/**/*.{ts,tsx}\"","precommit":"yarn format"},"type":"commonjs","author":{"name":"Yong Ming Yang"},"license":"ISC","devDependencies":{"@types/jest":"^29.2.3","ethers":"^5.7.2","typescript":"^4.9.3"},"dependencies":{"@types/jest":"^29.2.3","ethers":"^5.7.2","typescript":"^4.9.3"},"gitHead":"3824daa7100c6ba1dfeb0a02b2d6e55cd550aa7c","bugs":{"url":"https://github.com/AgreeWe/QuickWork/issues"},"homepage":"https://github.com/AgreeWe/QuickWork#readme","_id":"@agreewe/quickwork-sdk@1.0.1","_nodeVersion":"16.10.0","_npmVersion":"8.12.1","dist":{"integrity":"sha512-CheAvaej/Zv5ZgXA4q0f8wsc4pSxcK7jYOzTJyKeAThx2x6RFQl/F7tRy0BG6OGYtkv1Ci6GFueXtwMTKtebdQ==","shasum":"90825ce1c78e2c88476d1694b1bee869415f6ce5","tarball":"https://registry.npmjs.org/@agreewe/quickwork-sdk/-/quickwork-sdk-1.0.1.tgz","fileCount":2,"unpackedSize":5132,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDD1YRz/zU3TVHQtVF+Sfb1tzxr5XmvL/jrCmLrNnzekAiEA88cncCmEtrC7q9xxhqxW9yWCoqLa7i8FrA1CZDkO90g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjiUYLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmplBRAAh3aNFMRY9LOYej0quzj1WnkmFsjWoDzxZpoVOuy6qxpnkg97\r\n6XofEHIzG5v7UudUe5jKG87sfI4pDVH9qbBctVb9FjrV9iPeOWMdb2uDjqMx\r\nU/UuZv7jh1kW620wG0wW2ZHWl9NU0zGUoxgpLEYUBGHAEhc/Uye1apw3oU93\r\nAWbQhtpNv5sfg29R6UfdQ75UQSjowRiWw3iTbHsSHkrETZegsY7J4K6g4WvC\r\nCuSb1PHs3HTNDgfJL0zYfoJfGTARzP7qeb6bJoXgjvENYRSLecG+zZiTxXFI\r\n7G6gOI9nioxbojDCwen7LOhmkoNrdRYXNuaivd4qcAgc0wIibkzxc05AMHaV\r\nnlD9C6yUBVyrjEmi28SrxPewPjr6IDo95LNWGHJL06MqP3dKZx3VlkptLYxs\r\nQggwW+8rz+Rl5SQgm6hTIXg8n/Y8/dUrYLs/nGrq4qmLrfJAoF0xlbTl6EDU\r\nvWeHpzGg/bQEFoSWnD3jZ32l4oQh31tzdtUKch7GFz/+yHLE9INmVgtr8t4k\r\nLg/wA4NzBbg9NuFyqBn2VwF9Iaw1anLci46r6WuLe45I+x23s3dAZLv+qpTu\r\nbUb5n1Ff8G6eck4EL+EYiMI6NE8AyMDyZSDiP9G3y6BbHTUEuHElkSUDGS8e\r\nPcgkr1mnn0mM7okY57fvTTp8v6txWW1HK3g=\r\n=DtbN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"yongmingyang","email":"yongmingyang1998@gmail.com"},"directories":{},"maintainers":[{"name":"girish979","email":"girishkreddy@gmail.com"},{"name":"yongmingyang","email":"yongmingyang1998@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quickwork-sdk_1.0.1_1669940747111_0.8257252685488516"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-01T22:44:41.077Z","1.0.0":"2022-12-01T22:44:41.407Z","modified":"2022-12-02T00:25:47.448Z","1.0.1":"2022-12-02T00:25:47.338Z"},"maintainers":[{"name":"girish979","email":"girishkreddy@gmail.com"},{"name":"yongmingyang","email":"yongmingyang1998@gmail.com"}],"description":"Quickwork SDK to allow TS applications to interact with the Quickwork Smart Contract","homepage":"https://github.com/AgreeWe/QuickWork#readme","repository":{"type":"git","url":"git+https://github.com/AgreeWe/QuickWork.git"},"author":{"name":"Yong Ming Yang"},"bugs":{"url":"https://github.com/AgreeWe/QuickWork/issues"},"license":"ISC","readme":"# Introduction\n\nThis package acts as an interaction layer for the Solidity program found in contracts/quickwork.sol. Quickwork allows for tasks to be proposed by a group, and accomplished by an individual or another group. Once the tasks are deemed completed by the proposers, the various parties can sign on each individual deliverable and release the task bounty attached to each.\n\n## Installation instructions\n\nFirst, install this package via the command below.\n```\nnpm i @agreewe/solana-blockchain-contracts\n```\n\n## Initializing Quickwork Contract\n\nTypes and enums:\n```Typescript\nexport enum ApprovalType {\n  ALL = 0, // Requires all in the SignerList to sign on each deliverable to be considered completed\n  MAJORITY = 1 // Requires > 50% majority in SignerList to sign on each deliverable to be considered completed (e.g. 1/2, 6/11)\n}\n\nexport interface Deliverable {\n  task: string; // Task description\n  approvalType: ApprovalType; // Type of approval as seen above\n  completed: boolean, // Set to false unless it is already completed from the start\n  taskBounty: number // USDC amount - Take note of decimals: 2000000 = USDC $2\n\n}\n\nexport interface DeploymentArgs {\n  deliverableList: Deliverable[];\n  signerList: string[];\n  receiverAddress: string;\n  agreementEndDate: number; // unix timestamp\n  withdrawalAddress: string;\n}\n\n```\n\nIf you have not initialized a contract before, refer to the code below. \n\n**Only** wallet address in the SignerList are able to sign on task to deem it as completed. \n\nWithdrawal address will be the only wallet which can initiate withdrawAll function (only **after** current date is past the end date of the agreement)\n```Typescript\nimport { deployQuickWorkContract, DeploymentArgs } from 'quickwork-sdk';\nimport { ethers } from 'ethers';\n\nconst deploymentWallet = new ethers.Wallet(PRIVATE_KEY, new ethers.providers.JsonRpcProvider(GOERLI_RPC_URL)); \n\nconst params: DeploymentArgs = {\n    deliverableList: [{\n        task: \"Task 1\",\n        approvalType: 0,\n        completed: false,\n        taskBounty: 2000000 //in USDC\n    }, {\n        task: \"Task 2\",\n        approvalType: 1,\n        completed: false,\n        taskBounty: 3000000 //in USDC\n    }],\n    signerList: [signer1.address, signer2.address, signer3.address],\n    receiverAddress: signer1.address,\n    agreementEndDate: 1669934745,\n    withdrawalAddress: deploymentWallet.address, // Does NOT have to be the deployment wallet address. \n}\n\nconst deploy = async () => {\n    const contract = await deployQuickWorkContract(wallet1, params);\n    return contract.address;\n}\nconst contractAddr = deploy();\n```\nTake note that the contract has to be funded with >= USDC than the total USDC required for pay outs.\n\n## Initiating Quickwork Instance\n\n```Typescript\n    const quickworkInstance = new QuickWorkContract(deploymentWallet, contractAddress)\n```\n\n## Getting Deliverable Details\n\n``` Typescript\n    const firstTask = quickworkInstance.getDeliverable(deliverableNo)\n```\n\n## Signing Deliverable\n```Typescript\n    await quickworkInstance.signDeliverable(deliverableNo)\n```\n\n## Check If a Deliverable has been Signed by a Specific Party\n```Typescript\n    await quickworkInstance.isDeliverableApprovedBySigner(deliverableNo, address)\n```\n\n## Distribute Task Bounty for Specific Task\nThis can only be done if the task has been signed by sufficient number of signers and been marked as completed. Task will be automatically marked as completed if the requirements of number of signers are met.\n```Typescript\n        await quickworkInstance.releaseDeliverableSpecificFund(deliverableNo)\n```\n\n## Withdraw All\nThe withdraw all function withdraws all ETH and USDC in the contract to the withdrawalAddr wallet. This can only be done **if** the current time is past the end date of the agreement. This function can only be called by the withdrawalAddr specified when deploying the Quickwork Smart Contract.\n```Typescript\n    await quickworkInstance.withdrawAll()\n```\nThere are other functions such as getAgreementEndDate(), isUserAllowedToSign(), isDeliverablePaid(), getTotalSigners(), getReceiverAddress(), getSignerCountOnDeliverable() and more. These functions can be found in src/index.ts\n","readmeFilename":"README.md"}