diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 849106e..55bfb95 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,6 +4,9 @@ on: # Trigger only on release release: types: [created] + push: + branches: + - 'feature/**' jobs: checks: diff --git a/docs/package.json b/docs/package.json index 316c286..ec49659 100644 --- a/docs/package.json +++ b/docs/package.json @@ -38,8 +38,8 @@ ] }, "devDependencies": { - "docusaurus-plugin-typedoc": "^0.16.3", - "typedoc": "^0.22.5", - "typedoc-plugin-markdown": "^3.11.2" + "docusaurus-plugin-typedoc": "^0.16.9", + "typedoc": "^0.23.0", + "typedoc-plugin-markdown": "^3.11.10" } } diff --git a/middleware/models/Safes.js b/middleware/models/Safes.js index 8c3b6f4..08ed5b4 100644 --- a/middleware/models/Safes.js +++ b/middleware/models/Safes.js @@ -14,7 +14,6 @@ const Safes = { stage: { type: 'integer' }, encSafeKeyShards: { type: 'array' }, //=> [{status: 'recovered', encData : 'data', decData: 'data'}] onChain: {type: 'boolean'}, - claimType : {type: 'integer'}, sigalingPeriod: {type: 'integer'} }, }; diff --git a/middleware/thread.config b/middleware/thread.config index 796fd93..a3ac142 100644 --- a/middleware/thread.config +++ b/middleware/thread.config @@ -1 +1 @@ -{"threadId":[1,85,120,218,236,60,70,84,213,4,95,186,66,254,202,139,110,22,124,133,14,122,51,141,78,182,164,144,101,121,231,1,76,175]} \ No newline at end of file +{"threadId":[1,85,29,234,10,53,7,157,97,192,61,180,56,48,2,22,47,84,9,196,26,127,17,14,50,178,218,79,196,82,4,198,107,129]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 143508e..c142e8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@safient/core", - "version": "0.1.18-alpha", + "version": "0.1.19-alpha.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@safient/core", - "version": "0.1.18-alpha", + "version": "0.1.19-alpha.1", "dependencies": { "@ceramicnetwork/http-client": "^1.0.3", "@ceramicstudio/idx": "^0.12.0", "@ceramicstudio/idx-tools": "^0.10.0", "@ethersproject/providers": "^5.4.4", - "@safient/contracts": "^0.1.16-alpha", + "@safient/contracts": "^0.1.17-alpha", "@stablelib/random": "^1.0.1", "@textile/hub": "^6.3.1", "bcryptjs": "^2.4.3", @@ -78,7 +78,7 @@ }, "../contract-js": { "name": "@safient/contracts", - "version": "0.1.16-alpha", + "version": "0.1.17-alpha", "extraneous": true, "dependencies": { "@ethersproject/address": "^5.2.0", @@ -256,7 +256,7 @@ "node_modules/@ensdomains/ens/node_modules/ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { "node": ">=0.10.0" } @@ -264,7 +264,7 @@ "node_modules/@ensdomains/ens/node_modules/cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", "dependencies": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1", @@ -274,7 +274,7 @@ "node_modules/@ensdomains/ens/node_modules/decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "engines": { "node": ">=0.10.0" } @@ -282,7 +282,7 @@ "node_modules/@ensdomains/ens/node_modules/fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -299,7 +299,7 @@ "node_modules/@ensdomains/ens/node_modules/is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", "dependencies": { "number-is-nan": "^1.0.0" }, @@ -310,7 +310,7 @@ "node_modules/@ensdomains/ens/node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -318,7 +318,7 @@ "node_modules/@ensdomains/ens/node_modules/require-from-string": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "integrity": "sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==", "engines": { "node": ">=0.10.0" } @@ -349,7 +349,7 @@ "node_modules/@ensdomains/ens/node_modules/string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -362,7 +362,7 @@ "node_modules/@ensdomains/ens/node_modules/strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "dependencies": { "ansi-regex": "^2.0.0" }, @@ -373,7 +373,7 @@ "node_modules/@ensdomains/ens/node_modules/wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", "dependencies": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -390,7 +390,7 @@ "node_modules/@ensdomains/ens/node_modules/yargs": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", "dependencies": { "cliui": "^3.2.0", "decamelize": "^1.1.1", @@ -411,7 +411,7 @@ "node_modules/@ensdomains/ens/node_modules/yargs-parser": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", "dependencies": { "camelcase": "^3.0.0", "lodash.assign": "^4.0.6" @@ -497,25 +497,25 @@ } }, "node_modules/@ethereumjs/block": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", - "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.3.tgz", + "integrity": "sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==", "dependencies": { - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", - "ethereumjs-util": "^7.1.4", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "ethereumjs-util": "^7.1.5", "merkle-patricia-tree": "^4.2.4" } }, "node_modules/@ethereumjs/block/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/block/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -528,24 +528,24 @@ } }, "node_modules/@ethereumjs/blockchain": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", - "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz", + "integrity": "sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==", "dependencies": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/ethash": "^1.1.0", "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", + "ethereumjs-util": "^7.1.5", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "semaphore-async-await": "^1.5.1" } }, "node_modules/@ethereumjs/blockchain/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/blockchain/node_modules/debug": { "version": "4.3.4", @@ -564,9 +564,9 @@ } }, "node_modules/@ethereumjs/blockchain/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -584,23 +584,23 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@ethereumjs/common": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", - "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", "dependencies": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.5" } }, "node_modules/@ethereumjs/common/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/common/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -625,9 +625,9 @@ } }, "node_modules/@ethereumjs/ethash/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/ethash/node_modules/buffer-xor": { "version": "2.0.2", @@ -638,9 +638,9 @@ } }, "node_modules/@ethereumjs/ethash/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -653,23 +653,23 @@ } }, "node_modules/@ethereumjs/tx": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", - "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", "dependencies": { - "@ethereumjs/common": "^2.6.3", - "ethereumjs-util": "^7.1.4" + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" } }, "node_modules/@ethereumjs/tx/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/tx/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -682,18 +682,18 @@ } }, "node_modules/@ethereumjs/vm": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", - "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", - "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.4", - "@ethereumjs/tx": "^3.5.1", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.3.tgz", + "integrity": "sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg==", + "dependencies": { + "@ethereumjs/block": "^3.6.3", + "@ethereumjs/blockchain": "^5.5.3", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", + "ethereumjs-util": "^7.1.5", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "merkle-patricia-tree": "^4.2.4", @@ -701,9 +701,9 @@ } }, "node_modules/@ethereumjs/vm/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/@ethereumjs/vm/node_modules/debug": { "version": "4.3.4", @@ -722,9 +722,9 @@ } }, "node_modules/@ethereumjs/vm/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -1439,10 +1439,32 @@ "version": "4.0.1", "license": "MIT" }, + "node_modules/@noble/hashes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@noble/secp256k1": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz", + "integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, "node_modules/@nomiclabs/hardhat-ethers": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.5.tgz", - "integrity": "sha512-A2gZAGB6kUvLx+kzM92HKuUF33F1FSe90L0TmkXkT2Hh0OKRpvWZURUSU2nghD2yC4DzfEZ3DftfeHGvZ2JTUw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.1.0.tgz", + "integrity": "sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==", "peerDependencies": { "ethers": "^5.0.0", "hardhat": "^2.0.0" @@ -1571,9 +1593,9 @@ } }, "node_modules/@safient/contracts": { - "version": "0.1.16-alpha", - "resolved": "https://registry.npmjs.org/@safient/contracts/-/contracts-0.1.16-alpha.tgz", - "integrity": "sha512-zxYl43Q+sI3tvDlJQabv4hKUNFdLf01lDy9qW8GGiIOwevLnYgfQ4nOADqEqXPlZjxfZuv0gJvEKMVB+/f/ruw==", + "version": "0.1.17-alpha", + "resolved": "https://registry.npmjs.org/@safient/contracts/-/contracts-0.1.17-alpha.tgz", + "integrity": "sha512-gwrngpOfBxc/PsQF3d3wgtVaEfigzv82W9Q2znMe3pKsseOYjjb//Q/WRyBgRUqyx0RU63anvS0/lDEqJqQ6fQ==", "dependencies": { "@ethersproject/address": "^5.2.0", "@ethersproject/bignumber": "^5.2.0", @@ -1638,6 +1660,48 @@ "multiformats": "^9.4.2" } }, + "node_modules/@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/@scure/bip32": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.0.tgz", + "integrity": "sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.1.1", + "@noble/secp256k1": "~1.6.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@scure/bip39": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", + "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "@noble/hashes": "~1.1.1", + "@scure/base": "~1.1.0" + } + }, "node_modules/@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -1764,9 +1828,9 @@ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/@solidity-parser/parser": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.1.tgz", - "integrity": "sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.3.tgz", + "integrity": "sha512-29g2SZ29HtsqA58pLCtopI1P/cPy5/UAzlcAXO6T/CNJimG6yA8kx4NaseMyJULiC+TEs02Y9/yeHzClqoA0hw==", "dependencies": { "antlr4ts": "^0.5.0-alpha.4" } @@ -2307,9 +2371,9 @@ "license": "MIT" }, "node_modules/@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "dependencies": { "@types/node": "*", "form-data": "^3.0.0" @@ -2324,9 +2388,9 @@ } }, "node_modules/@types/prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.6.3.tgz", + "integrity": "sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg==" }, "node_modules/@types/resolve": { "version": "0.0.8", @@ -2345,9 +2409,9 @@ } }, "node_modules/@types/sinon": { - "version": "10.0.11", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz", - "integrity": "sha512-dmZsHlBsKUtBpHriNjlK0ndlvEh8dcb9uV9Afsbt89QIyydpC7NcR+nWlAhASfy3GHnxTl4FX/aKE7XZUt/B4g==", + "version": "10.0.13", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", + "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", "dependencies": { "@types/sinonjs__fake-timers": "*" } @@ -2631,7 +2695,7 @@ "node_modules/assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", "engines": { "node": ">=0.8" } @@ -2662,7 +2726,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -2677,7 +2741,7 @@ "node_modules/aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", "engines": { "node": "*" } @@ -2737,7 +2801,7 @@ "node_modules/bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "dependencies": { "tweetnacl": "^0.14.3" } @@ -2745,7 +2809,7 @@ "node_modules/bcrypt-pbkdf/node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" }, "node_modules/bcryptjs": { "version": "2.4.3", @@ -2895,7 +2959,7 @@ "node_modules/bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "dependencies": { "base-x": "^3.0.2" } @@ -2975,7 +3039,7 @@ "node_modules/camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", "engines": { "node": ">=0.10.0" } @@ -2996,7 +3060,7 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" }, "node_modules/cborg": { "version": "1.8.1", @@ -3170,7 +3234,7 @@ "node_modules/code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", "engines": { "node": ">=0.10.0" } @@ -3186,7 +3250,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/colors": { "version": "1.4.0", @@ -3254,9 +3318,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.22.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.2.tgz", - "integrity": "sha512-Lb+/XT4WC4PaCWWtZpNPaXmjiNDUe5CJuUtbkMrIM1kb1T/jJoAIp+bkVP/r5lHzMr+ZAAF8XHp7+my6Ol0ysQ==", + "version": "3.23.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.23.5.tgz", + "integrity": "sha512-8t78LdpKSuCq4pJYCYk8hl7XEkAX+BP16yRIwL3AanTksxuEf7CM83vRyctmiEL8NDZ3jpUcv56fk9/zG3aIuw==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -3266,7 +3330,7 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, "node_modules/cors": { "version": "2.8.5", @@ -3403,7 +3467,7 @@ "node_modules/dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "dependencies": { "assert-plus": "^1.0.0" }, @@ -3486,7 +3550,7 @@ "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", "engines": { "node": ">=0.4.0" } @@ -3636,7 +3700,7 @@ "node_modules/ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -3907,7 +3971,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "engines": { "node": ">=0.8.0" } @@ -3915,7 +3979,7 @@ "node_modules/eth-ens-namehash": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", "dependencies": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" @@ -3924,7 +3988,7 @@ "node_modules/eth-ens-namehash/node_modules/js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==" }, "node_modules/ethereum-bloom-filters": { "version": "1.0.10", @@ -4084,7 +4148,7 @@ "node_modules/ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", - "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", "dependencies": { "bn.js": "4.11.6", "number-to-bn": "1.7.0" @@ -4097,7 +4161,7 @@ "node_modules/ethjs-unit/node_modules/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" }, "node_modules/ethjs-util": { "version": "0.1.6", @@ -4139,7 +4203,7 @@ "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", "engines": [ "node >=0.6.0" ] @@ -4204,7 +4268,7 @@ "node_modules/find-replace": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", - "integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=", + "integrity": "sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA==", "dependencies": { "array-back": "^1.0.4", "test-value": "^2.1.0" @@ -4216,7 +4280,7 @@ "node_modules/find-replace/node_modules/array-back": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "dependencies": { "typical": "^2.6.0" }, @@ -4227,7 +4291,7 @@ "node_modules/find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "dependencies": { "locate-path": "^2.0.0" }, @@ -4251,9 +4315,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", "funding": [ { "type": "individual", @@ -4276,7 +4340,7 @@ "node_modules/forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", "engines": { "node": "*" } @@ -4336,7 +4400,7 @@ "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" }, "node_modules/ganache-core": { "version": "2.13.2", @@ -12663,7 +12727,7 @@ "node_modules/getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "dependencies": { "assert-plus": "^1.0.0" } @@ -12716,7 +12780,7 @@ "node_modules/har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", "engines": { "node": ">=4" } @@ -12755,19 +12819,19 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/hardhat": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", - "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", - "dependencies": { - "@ethereumjs/block": "^3.6.0", - "@ethereumjs/blockchain": "^5.5.0", - "@ethereumjs/common": "^2.6.0", - "@ethereumjs/tx": "^3.4.0", - "@ethereumjs/vm": "^5.6.0", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.10.1.tgz", + "integrity": "sha512-0FN9TyCtn7Lt25SB2ei2G7nA2rZjP+RN6MvFOm+zYwherxLZNo6RbD8nDz88eCbhRapevmXqOiL2nM8INKsjmA==", + "dependencies": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.9.0", "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.14.2", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", @@ -12780,19 +12844,19 @@ "debug": "^4.1.1", "enquirer": "^2.3.0", "env-paths": "^2.2.0", - "ethereum-cryptography": "^0.1.2", + "ethereum-cryptography": "^1.0.3", "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^7.1.3", + "ethereumjs-util": "^7.1.4", "find-up": "^2.1.0", "fp-ts": "1.19.3", "fs-extra": "^7.0.1", - "glob": "^7.1.3", + "glob": "7.2.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", - "merkle-patricia-tree": "^4.2.2", + "merkle-patricia-tree": "^4.2.4", "mnemonist": "^0.38.0", - "mocha": "^9.2.0", + "mocha": "^10.0.0", "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", @@ -12804,7 +12868,7 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", - "undici": "^4.14.1", + "undici": "^5.4.0", "uuid": "^8.3.2", "ws": "^7.4.6" }, @@ -12812,13 +12876,33 @@ "hardhat": "internal/cli/cli.js" }, "engines": { - "node": "^12.0.0 || ^14.0.0 || ^16.0.0" + "node": "^14.0.0 || ^16.0.0 || ^18.0.0" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } } }, "node_modules/hardhat/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "node_modules/hardhat/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } }, "node_modules/hardhat/node_modules/commander": { "version": "3.0.2", @@ -12841,10 +12925,37 @@ } } }, + "node_modules/hardhat/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/hardhat/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/ethereum-cryptography": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.1.2.tgz", + "integrity": "sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ==", + "dependencies": { + "@noble/hashes": "1.1.2", + "@noble/secp256k1": "1.6.3", + "@scure/bip32": "1.1.0", + "@scure/bip39": "1.1.0" + } + }, "node_modules/hardhat/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -12856,6 +12967,28 @@ "node": ">=10.0.0" } }, + "node_modules/hardhat/node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, "node_modules/hardhat/node_modules/fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -12869,18 +13002,162 @@ "node": ">=6 <7 || >=8" } }, + "node_modules/hardhat/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, "node_modules/hardhat/node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "optionalDependencies": { "graceful-fs": "^4.1.6" } }, - "node_modules/hardhat/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/hardhat/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/hardhat/node_modules/mocha": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" + } + }, + "node_modules/hardhat/node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/hardhat/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hardhat/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/hardhat/node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "hasInstallScript": true, + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } }, "node_modules/hardhat/node_modules/solc": { "version": "0.7.3", @@ -12907,7 +13184,7 @@ "node_modules/hardhat/node_modules/solc/node_modules/fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -12919,7 +13196,7 @@ "node_modules/hardhat/node_modules/solc/node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -12932,6 +13209,20 @@ "semver": "bin/semver" } }, + "node_modules/hardhat/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/hardhat/node_modules/universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -12948,6 +13239,11 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/hardhat/node_modules/workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==" + }, "node_modules/has": { "version": "1.0.3", "license": "MIT", @@ -12972,7 +13268,7 @@ "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "engines": { "node": ">=4" } @@ -13067,7 +13363,7 @@ "node_modules/http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -13157,9 +13453,9 @@ "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, "node_modules/immutable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", - "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==" }, "node_modules/indent-string": { "version": "4.0.0", @@ -13219,7 +13515,7 @@ "node_modules/invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==", "engines": { "node": ">=0.10.0" } @@ -13507,7 +13803,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "node_modules/is-bigint": { "version": "1.0.4", @@ -13640,7 +13936,7 @@ "node_modules/is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", "engines": { "node": ">=6.5.0", "npm": ">=3" @@ -13753,7 +14049,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "node_modules/is-unicode-supported": { "version": "0.1.0", @@ -13773,7 +14069,7 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" }, "node_modules/is-weakref": { "version": "1.0.2", @@ -13818,7 +14114,7 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, "node_modules/it-all": { "version": "1.0.6", @@ -13911,7 +14207,7 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" }, "node_modules/json-schema": { "version": "0.4.0", @@ -13925,7 +14221,7 @@ "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, "node_modules/json-text-sequence": { "version": "0.1.1", @@ -14029,7 +14325,7 @@ "node_modules/klaw": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", "optionalDependencies": { "graceful-fs": "^4.1.9" } @@ -14045,7 +14341,7 @@ "node_modules/lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", "dependencies": { "invert-kv": "^1.0.0" }, @@ -14162,7 +14458,7 @@ "node_modules/load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dependencies": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", @@ -14177,7 +14473,7 @@ "node_modules/locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "dependencies": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -14194,7 +14490,7 @@ "node_modules/lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" }, "node_modules/lodash.clonedeep": { "version": "4.5.0", @@ -14333,7 +14629,7 @@ "node_modules/lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" }, "node_modules/lru-cache": { "version": "5.1.1", @@ -14346,7 +14642,7 @@ "node_modules/ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" }, "node_modules/mcl-wasm": { "version": "0.7.9", @@ -14399,12 +14695,12 @@ "node_modules/memdown/node_modules/immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==" }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", "engines": { "node": ">= 0.10.0" } @@ -14434,14 +14730,14 @@ } }, "node_modules/merkle-patricia-tree/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/merkle-patricia-tree/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -14943,9 +15239,9 @@ } }, "node_modules/node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -14981,7 +15277,7 @@ "node_modules/number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "engines": { "node": ">=0.10.0" } @@ -14989,7 +15285,7 @@ "node_modules/number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", - "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", "dependencies": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -15002,7 +15298,7 @@ "node_modules/number-to-bn/node_modules/bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" }, "node_modules/oauth-sign": { "version": "0.9.0", @@ -15050,9 +15346,9 @@ } }, "node_modules/obliterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.3.tgz", - "integrity": "sha512-qN5lHhArxl/789Bp3XCpssAYy7cvOdRzxzflmGEJaiipAT2b/USr1XvKjYyssPOwQ/3KjV1e8Ed9po9rie6E6A==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==" }, "node_modules/once": { "version": "1.4.0", @@ -15079,7 +15375,7 @@ "node_modules/os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", "dependencies": { "lcid": "^1.0.0" }, @@ -15090,7 +15386,7 @@ "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", "engines": { "node": ">=0.10.0" } @@ -15126,7 +15422,7 @@ "node_modules/p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "dependencies": { "p-limit": "^1.1.0" }, @@ -15151,7 +15447,7 @@ "node_modules/p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", "engines": { "node": ">=4" } @@ -15183,7 +15479,7 @@ "node_modules/parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "dependencies": { "error-ex": "^1.2.0" }, @@ -15249,7 +15545,7 @@ "node_modules/patch-package/node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -15294,7 +15590,7 @@ "node_modules/path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", "engines": { "node": ">=4" } @@ -15309,7 +15605,7 @@ "node_modules/path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", "engines": { "node": ">=4" } @@ -15322,7 +15618,7 @@ "node_modules/path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "dependencies": { "graceful-fs": "^4.1.2", "pify": "^2.0.0", @@ -15357,7 +15653,7 @@ "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -15372,7 +15668,7 @@ "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", "engines": { "node": ">=0.10.0" } @@ -15380,7 +15676,7 @@ "node_modules/pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", "engines": { "node": ">=0.10.0" } @@ -15388,7 +15684,7 @@ "node_modules/pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "dependencies": { "pinkie": "^2.0.0" }, @@ -15403,9 +15699,9 @@ "hasInstallScript": true }, "node_modules/prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "bin": { "prettier": "bin-prettier.js" }, @@ -15444,12 +15740,12 @@ "node_modules/prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" }, "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "node_modules/punycode": { "version": "2.1.0", @@ -15467,9 +15763,9 @@ } }, "node_modules/qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "dependencies": { "side-channel": "^1.0.4" }, @@ -15499,7 +15795,7 @@ "node_modules/querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==", "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", "engines": { "node": ">=0.4.x" @@ -15542,7 +15838,7 @@ "node_modules/read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dependencies": { "load-json-file": "^1.0.0", "normalize-package-data": "^2.3.2", @@ -15555,7 +15851,7 @@ "node_modules/read-pkg-up": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dependencies": { "find-up": "^1.0.0", "read-pkg": "^1.0.0" @@ -15567,7 +15863,7 @@ "node_modules/read-pkg-up/node_modules/find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "dependencies": { "path-exists": "^2.0.0", "pinkie-promise": "^2.0.0" @@ -15579,7 +15875,7 @@ "node_modules/read-pkg-up/node_modules/path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "dependencies": { "pinkie-promise": "^2.0.0" }, @@ -15689,7 +15985,7 @@ "node_modules/require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" }, "node_modules/resolve": { "version": "1.17.0", @@ -15738,9 +16034,9 @@ } }, "node_modules/rlp/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/rpc-utils": { "version": "0.3.4", @@ -15793,7 +16089,7 @@ "node_modules/scryptsy": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "integrity": "sha512-aldIRgMozSJ/Gl6K6qmJZysRP82lz83Wb42vl4PWN8SaLFHIaOzLPc9nUUW2jQN88CuGm5q5HefJ9jZ3nWSmTw==", "dependencies": { "pbkdf2": "^3.0.3" } @@ -15824,7 +16120,7 @@ "node_modules/semaphore-async-await": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=", + "integrity": "sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==", "engines": { "node": ">=4.1" } @@ -15856,12 +16152,12 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" }, "node_modules/setprototypeof": { "version": "1.2.0", @@ -15886,7 +16182,7 @@ "node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "dependencies": { "shebang-regex": "^1.0.0" }, @@ -15897,7 +16193,7 @@ "node_modules/shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", "engines": { "node": ">=0.10.0" } @@ -16066,7 +16362,7 @@ "node_modules/solc/node_modules/fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "dependencies": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -16078,7 +16374,7 @@ "node_modules/solc/node_modules/jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -16179,7 +16475,7 @@ "node_modules/sshpk/node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" }, "node_modules/stacktrace-parser": { "version": "0.1.10", @@ -16287,7 +16583,7 @@ "node_modules/strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "dependencies": { "is-utf8": "^0.2.0" }, @@ -16298,7 +16594,7 @@ "node_modules/strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", "dependencies": { "is-hex-prefixed": "1.0.0" }, @@ -16331,7 +16627,7 @@ "node_modules/test-value": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=", + "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", "dependencies": { "array-back": "^1.0.3", "typical": "^2.6.0" @@ -16343,7 +16639,7 @@ "node_modules/test-value/node_modules/array-back": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "dependencies": { "typical": "^2.6.0" }, @@ -16475,12 +16771,12 @@ "node_modules/tsort": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=" + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==" }, "node_modules/tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "dependencies": { "safe-buffer": "^5.0.1" }, @@ -16564,7 +16860,7 @@ "node_modules/typechain/node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -16608,7 +16904,7 @@ "node_modules/typical": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=" + "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==" }, "node_modules/uint8arrays": { "version": "2.1.10", @@ -16631,9 +16927,9 @@ } }, "node_modules/undici": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", - "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.8.0.tgz", + "integrity": "sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==", "engines": { "node": ">=12.18" } @@ -16667,7 +16963,7 @@ "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "engines": { "node": ">= 0.8" } @@ -16696,7 +16992,7 @@ "node_modules/url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -16705,7 +17001,7 @@ "node_modules/url/node_modules/punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" }, "node_modules/utf8": { "version": "3.0.0", @@ -16759,7 +17055,7 @@ "node_modules/verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "engines": [ "node >=0.6.0" ], @@ -16792,11 +17088,11 @@ } }, "node_modules/web3-utils": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.3.tgz", - "integrity": "sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.4.tgz", + "integrity": "sha512-acBdm6Evd0TEZRnChM/MCvGsMwYKmSh7OaUfNf5OKG0CIeGWD/6gqLOWIwmwSnre/2WrA1nKGId5uW2e5EfluA==", "dependencies": { - "bn.js": "^4.11.9", + "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", "ethereumjs-util": "^7.1.0", "ethjs-unit": "0.1.6", @@ -16808,10 +17104,15 @@ "node": ">=8.0.0" } }, + "node_modules/web3-utils/node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, "node_modules/web3-utils/node_modules/ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "dependencies": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -16823,11 +17124,6 @@ "node": ">=10.0.0" } }, - "node_modules/web3-utils/node_modules/ethereumjs-util/node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, "node_modules/which": { "version": "2.0.2", "license": "ISC", @@ -16858,7 +17154,7 @@ "node_modules/which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==" }, "node_modules/which-typed-array": { "version": "1.1.7", @@ -16881,7 +17177,7 @@ "node_modules/window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==", "bin": { "window-size": "cli.js" }, @@ -17170,12 +17466,12 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" }, "cliui": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1", @@ -17185,12 +17481,12 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==" }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -17207,7 +17503,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", "requires": { "number-is-nan": "^1.0.0" } @@ -17215,7 +17511,7 @@ "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "requires": { "graceful-fs": "^4.1.6" } @@ -17223,7 +17519,7 @@ "require-from-string": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", - "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=" + "integrity": "sha512-H7AkJWMobeskkttHyhTVtS0fxpFLjxhbfMa6Bk3wimP7sdPRGL3EyCg3sAQenFfAe+xQ+oAc85Nmtvq0ROM83Q==" }, "semver": { "version": "5.7.1", @@ -17245,7 +17541,7 @@ "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -17255,7 +17551,7 @@ "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "requires": { "ansi-regex": "^2.0.0" } @@ -17263,7 +17559,7 @@ "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -17277,7 +17573,7 @@ "yargs": { "version": "4.8.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=", + "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", "requires": { "cliui": "^3.2.0", "decamelize": "^1.1.1", @@ -17298,7 +17594,7 @@ "yargs-parser": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=", + "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", "requires": { "camelcase": "^3.0.0", "lodash.assign": "^4.0.6" @@ -17370,25 +17666,25 @@ } }, "@ethereumjs/block": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.2.tgz", - "integrity": "sha512-mOqYWwMlAZpYUEOEqt7EfMFuVL2eyLqWWIzcf4odn6QgXY8jBI2NhVuJncrMCKeMZrsJAe7/auaRRB6YcdH+Qw==", + "version": "3.6.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.3.tgz", + "integrity": "sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==", "requires": { - "@ethereumjs/common": "^2.6.3", - "@ethereumjs/tx": "^3.5.1", - "ethereumjs-util": "^7.1.4", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", + "ethereumjs-util": "^7.1.5", "merkle-patricia-tree": "^4.2.4" }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17400,24 +17696,24 @@ } }, "@ethereumjs/blockchain": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.2.tgz", - "integrity": "sha512-Jz26iJmmsQtngerW6r5BDFaew/f2mObLrRZo3rskLOx1lmtMZ8+TX/vJexmivrnWgmAsTdNWhlKUYY4thPhPig==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz", + "integrity": "sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==", "requires": { "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.3", + "@ethereumjs/common": "^2.6.4", "@ethereumjs/ethash": "^1.1.0", "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", + "ethereumjs-util": "^7.1.5", "level-mem": "^5.0.1", "lru-cache": "^5.1.1", "semaphore-async-await": "^1.5.1" }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "debug": { "version": "4.3.4", @@ -17428,9 +17724,9 @@ } }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17447,23 +17743,23 @@ } }, "@ethereumjs/common": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.4.tgz", - "integrity": "sha512-RDJh/R/EAr+B7ZRg5LfJ0BIpf/1LydFgYdvZEuTraojCbVypO2sQ+QnpP5u2wJf9DASyooKqu8O4FJEWUV6NXw==", + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", + "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", "requires": { "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.4" + "ethereumjs-util": "^7.1.5" }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17487,9 +17783,9 @@ }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "buffer-xor": { "version": "2.0.2", @@ -17500,9 +17796,9 @@ } }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17514,23 +17810,23 @@ } }, "@ethereumjs/tx": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.1.tgz", - "integrity": "sha512-xzDrTiu4sqZXUcaBxJ4n4W5FrppwxLxZB4ZDGVLtxSQR4lVuOnFR6RcUHdg1mpUhAPVrmnzLJpxaeXnPxIyhWA==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", + "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", "requires": { - "@ethereumjs/common": "^2.6.3", - "ethereumjs-util": "^7.1.4" + "@ethereumjs/common": "^2.6.4", + "ethereumjs-util": "^7.1.5" }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17542,18 +17838,18 @@ } }, "@ethereumjs/vm": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.0.tgz", - "integrity": "sha512-0IRsj4IuF8lFDWVVLc4mFOImaSX8VWF8CGm3mXHG/LLlQ/Tryy/kKXMw/bU9D+Zw03CdteW+wCGqNFS6+mPjpg==", - "requires": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/blockchain": "^5.5.2", - "@ethereumjs/common": "^2.6.4", - "@ethereumjs/tx": "^3.5.1", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/@ethereumjs/vm/-/vm-5.9.3.tgz", + "integrity": "sha512-Ha04TeF8goEglr8eL7hkkYyjhzdZS0PsoRURzYlTF6I0VVId5KjKb0N7MrA8GMgheN+UeTncfTgYx52D/WhEmg==", + "requires": { + "@ethereumjs/block": "^3.6.3", + "@ethereumjs/blockchain": "^5.5.3", + "@ethereumjs/common": "^2.6.5", + "@ethereumjs/tx": "^3.5.2", "async-eventemitter": "^0.2.4", "core-js-pure": "^3.0.1", "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", + "ethereumjs-util": "^7.1.5", "functional-red-black-tree": "^1.0.1", "mcl-wasm": "^0.7.1", "merkle-patricia-tree": "^4.2.4", @@ -17561,9 +17857,9 @@ }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "debug": { "version": "4.3.4", @@ -17574,9 +17870,9 @@ } }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -17953,10 +18249,20 @@ "@multiformats/base-x": { "version": "4.0.1" }, + "@noble/hashes": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==" + }, + "@noble/secp256k1": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz", + "integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==" + }, "@nomiclabs/hardhat-ethers": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.0.5.tgz", - "integrity": "sha512-A2gZAGB6kUvLx+kzM92HKuUF33F1FSe90L0TmkXkT2Hh0OKRpvWZURUSU2nghD2yC4DzfEZ3DftfeHGvZ2JTUw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.1.0.tgz", + "integrity": "sha512-vlW90etB3675QWG7tMrHaDoTa7ymMB7irM4DAQ98g8zJoe9YqEggeDnbO6v5b+BLth/ty4vN6Ko/kaqRN1krHw==", "requires": {} }, "@nomiclabs/hardhat-waffle": { @@ -18074,9 +18380,9 @@ } }, "@safient/contracts": { - "version": "0.1.16-alpha", - "resolved": "https://registry.npmjs.org/@safient/contracts/-/contracts-0.1.16-alpha.tgz", - "integrity": "sha512-zxYl43Q+sI3tvDlJQabv4hKUNFdLf01lDy9qW8GGiIOwevLnYgfQ4nOADqEqXPlZjxfZuv0gJvEKMVB+/f/ruw==", + "version": "0.1.17-alpha", + "resolved": "https://registry.npmjs.org/@safient/contracts/-/contracts-0.1.17-alpha.tgz", + "integrity": "sha512-gwrngpOfBxc/PsQF3d3wgtVaEfigzv82W9Q2znMe3pKsseOYjjb//Q/WRyBgRUqyx0RU63anvS0/lDEqJqQ6fQ==", "requires": { "@ethersproject/address": "^5.2.0", "@ethersproject/bignumber": "^5.2.0", @@ -18140,6 +18446,30 @@ } } }, + "@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==" + }, + "@scure/bip32": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.0.tgz", + "integrity": "sha512-ftTW3kKX54YXLCxH6BB7oEEoJfoE2pIgw7MINKAs5PsS6nqKPuKk1haTF/EuHmYqG330t5GSrdmtRuHaY1a62Q==", + "requires": { + "@noble/hashes": "~1.1.1", + "@noble/secp256k1": "~1.6.0", + "@scure/base": "~1.1.0" + } + }, + "@scure/bip39": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.0.tgz", + "integrity": "sha512-pwrPOS16VeTKg98dYXQyIjJEcWfz7/1YJIwxUEPFfQPtc86Ym/1sVgQ2RLoD43AazMk2l/unK4ITySSpW2+82w==", + "requires": { + "@noble/hashes": "~1.1.1", + "@scure/base": "~1.1.0" + } + }, "@sentry/core": { "version": "5.30.0", "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", @@ -18257,9 +18587,9 @@ } }, "@solidity-parser/parser": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.1.tgz", - "integrity": "sha512-eLjj2L6AuQjBB6s/ibwCAc0DwrR5Ge+ys+wgWo+bviU7fV2nTMQhU63CGaDKXg9iTmMxwhkyoggdIR7ZGRfMgw==", + "version": "0.14.3", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.3.tgz", + "integrity": "sha512-29g2SZ29HtsqA58pLCtopI1P/cPy5/UAzlcAXO6T/CNJimG6yA8kx4NaseMyJULiC+TEs02Y9/yeHzClqoA0hw==", "requires": { "antlr4ts": "^0.5.0-alpha.4" } @@ -18736,9 +19066,9 @@ "version": "15.14.9" }, "@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==", "requires": { "@types/node": "*", "form-data": "^3.0.0" @@ -18753,9 +19083,9 @@ } }, "@types/prettier": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.6.0.tgz", - "integrity": "sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw==" + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.6.3.tgz", + "integrity": "sha512-ymZk3LEC/fsut+/Q5qejp6R9O1rMxz3XaRHDV6kX8MrGAhOSPqVARbDi+EZvInBpw+BnCX3TD240byVkOfQsHg==" }, "@types/resolve": { "version": "0.0.8", @@ -18774,9 +19104,9 @@ } }, "@types/sinon": { - "version": "10.0.11", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.11.tgz", - "integrity": "sha512-dmZsHlBsKUtBpHriNjlK0ndlvEh8dcb9uV9Afsbt89QIyydpC7NcR+nWlAhASfy3GHnxTl4FX/aKE7XZUt/B4g==", + "version": "10.0.13", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", + "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", "requires": { "@types/sinonjs__fake-timers": "*" } @@ -18985,7 +19315,7 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==" }, "assertion-error": { "version": "1.1.0" @@ -19009,7 +19339,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "available-typed-arrays": { "version": "1.0.5" @@ -19017,7 +19347,7 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==" }, "aws4": { "version": "1.11.0", @@ -19050,7 +19380,7 @@ "bcrypt-pbkdf": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", "requires": { "tweetnacl": "^0.14.3" }, @@ -19058,7 +19388,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" } } }, @@ -19180,7 +19510,7 @@ "bs58": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", "requires": { "base-x": "^3.0.2" } @@ -19235,7 +19565,7 @@ "camelcase": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" }, "canonicalize": { "version": "1.0.8" @@ -19251,7 +19581,7 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" }, "cborg": { "version": "1.8.1", @@ -19379,7 +19709,7 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==" }, "color-convert": { "version": "1.9.3", @@ -19392,7 +19722,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "colors": { "version": "1.4.0" @@ -19443,14 +19773,14 @@ "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" }, "core-js-pure": { - "version": "3.22.2", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.22.2.tgz", - "integrity": "sha512-Lb+/XT4WC4PaCWWtZpNPaXmjiNDUe5CJuUtbkMrIM1kb1T/jJoAIp+bkVP/r5lHzMr+ZAAF8XHp7+my6Ol0ysQ==" + "version": "3.23.5", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.23.5.tgz", + "integrity": "sha512-8t78LdpKSuCq4pJYCYk8hl7XEkAX+BP16yRIwL3AanTksxuEf7CM83vRyctmiEL8NDZ3jpUcv56fk9/zG3aIuw==" }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, "cors": { "version": "2.8.5", @@ -19560,7 +19890,7 @@ "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", "requires": { "assert-plus": "^1.0.0" } @@ -19617,7 +19947,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "delimit-stream": { "version": "0.1.0" @@ -19737,7 +20067,7 @@ "ecc-jsbn": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -19940,12 +20270,12 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "eth-ens-namehash": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz", - "integrity": "sha1-IprEbsqG1S4MmR58sq74P/D2i88=", + "integrity": "sha512-VWEI1+KJfz4Km//dadyvBBoBeSQ0MHTXPvr8UIXiLW6IanxvAV+DmlZAijZwAyggqGUfwQBeHf7tc9wzc1piSw==", "requires": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" @@ -19954,7 +20284,7 @@ "js-sha3": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "integrity": "sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g==" } } }, @@ -20099,7 +20429,7 @@ "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", - "integrity": "sha1-xmWSHkduh7ziqdWIpv4EBbLEFpk=", + "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", "requires": { "bn.js": "4.11.6", "number-to-bn": "1.7.0" @@ -20108,7 +20438,7 @@ "bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" } } }, @@ -20142,7 +20472,7 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==" }, "fast-deep-equal": { "version": "3.1.3" @@ -20188,7 +20518,7 @@ "find-replace": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", - "integrity": "sha1-uI5zZNLZyVlVnziMZmcNYTBEH6A=", + "integrity": "sha512-KrUnjzDCD9426YnCP56zGYy/eieTnhtK6Vn++j+JJzmlsWWwEkDnsyVF575spT6HJ6Ow9tlbT3TQTDsa+O4UWA==", "requires": { "array-back": "^1.0.4", "test-value": "^2.1.0" @@ -20197,7 +20527,7 @@ "array-back": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "requires": { "typical": "^2.6.0" } @@ -20207,7 +20537,7 @@ "find-up": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", "requires": { "locate-path": "^2.0.0" } @@ -20224,9 +20554,9 @@ "version": "5.0.2" }, "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" }, "foreach": { "version": "2.0.5" @@ -20234,7 +20564,7 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==" }, "form-data": { "version": "3.0.1", @@ -20276,7 +20606,7 @@ "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" }, "ganache-core": { "version": "2.13.2", @@ -26457,7 +26787,7 @@ "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", "requires": { "assert-plus": "^1.0.0" } @@ -26495,7 +26825,7 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==" }, "har-validator": { "version": "5.1.5", @@ -26525,19 +26855,19 @@ } }, "hardhat": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.9.3.tgz", - "integrity": "sha512-7Vw99RbYbMZ15UzegOR/nqIYIqddZXvLwJGaX5sX4G5bydILnbjmDU6g3jMKJSiArEixS3vHAEaOs5CW1JQ3hg==", - "requires": { - "@ethereumjs/block": "^3.6.0", - "@ethereumjs/blockchain": "^5.5.0", - "@ethereumjs/common": "^2.6.0", - "@ethereumjs/tx": "^3.4.0", - "@ethereumjs/vm": "^5.6.0", + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.10.1.tgz", + "integrity": "sha512-0FN9TyCtn7Lt25SB2ei2G7nA2rZjP+RN6MvFOm+zYwherxLZNo6RbD8nDz88eCbhRapevmXqOiL2nM8INKsjmA==", + "requires": { + "@ethereumjs/block": "^3.6.2", + "@ethereumjs/blockchain": "^5.5.2", + "@ethereumjs/common": "^2.6.4", + "@ethereumjs/tx": "^3.5.1", + "@ethereumjs/vm": "^5.9.0", "@ethersproject/abi": "^5.1.2", "@metamask/eth-sig-util": "^4.0.0", "@sentry/node": "^5.18.1", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.14.2", "@types/bn.js": "^5.1.0", "@types/lru-cache": "^5.1.0", "abort-controller": "^3.0.0", @@ -26550,19 +26880,19 @@ "debug": "^4.1.1", "enquirer": "^2.3.0", "env-paths": "^2.2.0", - "ethereum-cryptography": "^0.1.2", + "ethereum-cryptography": "^1.0.3", "ethereumjs-abi": "^0.6.8", - "ethereumjs-util": "^7.1.3", + "ethereumjs-util": "^7.1.4", "find-up": "^2.1.0", "fp-ts": "1.19.3", "fs-extra": "^7.0.1", - "glob": "^7.1.3", + "glob": "7.2.0", "immutable": "^4.0.0-rc.12", "io-ts": "1.10.4", "lodash": "^4.17.11", - "merkle-patricia-tree": "^4.2.2", + "merkle-patricia-tree": "^4.2.4", "mnemonist": "^0.38.0", - "mocha": "^9.2.0", + "mocha": "^10.0.0", "p-map": "^4.0.0", "qs": "^6.7.0", "raw-body": "^2.4.1", @@ -26574,15 +26904,23 @@ "stacktrace-parser": "^0.1.10", "true-case-path": "^2.2.1", "tsort": "0.0.1", - "undici": "^4.14.1", + "undici": "^5.4.0", "uuid": "^8.3.2", "ws": "^7.4.6" }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "requires": { + "balanced-match": "^1.0.0" + } }, "commander": { "version": "3.0.2", @@ -26595,18 +26933,65 @@ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, + "ethereum-cryptography": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.1.2.tgz", + "integrity": "sha512-XDSJlg4BD+hq9N2FjvotwUET9Tfxpxc3kWGE2AqUG5vcbeunnbImVk3cj6e/xT3phdW21mE8R5IugU4fspQDcQ==", + "requires": { + "@noble/hashes": "1.1.2", + "@noble/secp256k1": "1.6.3", + "@scure/bip32": "1.1.0", + "@scure/bip39": "1.1.0" } }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", "create-hash": "^1.1.2", "ethereum-cryptography": "^0.1.3", "rlp": "^2.2.4" + }, + "dependencies": { + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + } } }, "fs-extra": { @@ -26619,18 +27004,110 @@ "universalify": "^0.1.0" } }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "requires": { "graceful-fs": "^4.1.6" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "minimatch": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", + "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "mocha": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", + "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + } + } + }, + "nanoid": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", + "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==" + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "requires": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } }, "solc": { "version": "0.7.3", @@ -26651,7 +27128,7 @@ "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -26663,7 +27140,7 @@ "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "requires": { "graceful-fs": "^4.1.6" } @@ -26675,6 +27152,14 @@ } } }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "requires": { + "has-flag": "^4.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -26684,6 +27169,11 @@ "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "workerpool": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", + "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==" } } }, @@ -26702,7 +27192,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, "has-symbols": { "version": "1.0.2" @@ -26766,7 +27256,7 @@ "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -26822,9 +27312,9 @@ "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" }, "immutable": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz", - "integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.1.0.tgz", + "integrity": "sha512-oNkuqVTA8jqG1Q6c+UglTOD1xhC1BtjKI7XkCXRkZHrN5m18/XsnUp8Q89GkQO/z+0WjonSvl0FLhDYftp46nQ==" }, "indent-string": { "version": "4.0.0", @@ -26877,7 +27367,7 @@ "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==" }, "io-ts": { "version": "1.10.4", @@ -27115,7 +27605,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==" }, "is-bigint": { "version": "1.0.4", @@ -27187,7 +27677,7 @@ "is-hex-prefixed": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==" }, "is-ip": { "version": "3.1.0", @@ -27242,7 +27732,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" }, "is-unicode-supported": { "version": "0.1.0" @@ -27255,7 +27745,7 @@ "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q==" }, "is-weakref": { "version": "1.0.2", @@ -27286,7 +27776,7 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, "it-all": { "version": "1.0.6", @@ -27361,7 +27851,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==" }, "json-schema": { "version": "0.4.0", @@ -27374,7 +27864,7 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, "json-text-sequence": { "version": "0.1.1", @@ -27464,7 +27954,7 @@ "klaw": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", - "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==", "requires": { "graceful-fs": "^4.1.9" } @@ -27480,7 +27970,7 @@ "lcid": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==", "requires": { "invert-kv": "^1.0.0" } @@ -27567,7 +28057,7 @@ "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "requires": { "graceful-fs": "^4.1.2", "parse-json": "^2.2.0", @@ -27579,7 +28069,7 @@ "locate-path": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -27593,7 +28083,7 @@ "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" }, "lodash.clonedeep": { "version": "4.5.0" @@ -27680,7 +28170,7 @@ "lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==" }, "lru-cache": { "version": "5.1.1", @@ -27693,7 +28183,7 @@ "ltgt": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" }, "mcl-wasm": { "version": "0.7.9", @@ -27736,14 +28226,14 @@ "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==" } } }, "memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", - "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=" + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==" }, "merge-options": { "version": "3.0.4", @@ -27767,14 +28257,14 @@ }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", @@ -28128,9 +28618,9 @@ "integrity": "sha512-iTASGs+HTFK5E4ZqcMsHmeJ4zodyq8L38lZV33jwqcBJYoUt3HjN4+ot+O9/0b+ke8ddE7UgOtVuZN/OkV19/g==" }, "node-gyp-build": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.5.0.tgz", + "integrity": "sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==" }, "normalize-package-data": { "version": "2.5.0", @@ -28156,12 +28646,12 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==" }, "number-to-bn": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", - "integrity": "sha1-uzYjWS9+X54AMLGXe9QaDFP+HqA=", + "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", "requires": { "bn.js": "4.11.6", "strip-hex-prefix": "1.0.0" @@ -28170,7 +28660,7 @@ "bn.js": { "version": "4.11.6", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", - "integrity": "sha1-UzRK2xRhehP26N0s4okF0cC6MhU=" + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==" } } }, @@ -28198,9 +28688,9 @@ } }, "obliterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.3.tgz", - "integrity": "sha512-qN5lHhArxl/789Bp3XCpssAYy7cvOdRzxzflmGEJaiipAT2b/USr1XvKjYyssPOwQ/3KjV1e8Ed9po9rie6E6A==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==" }, "once": { "version": "1.4.0", @@ -28220,7 +28710,7 @@ "os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==", "requires": { "lcid": "^1.0.0" } @@ -28228,7 +28718,7 @@ "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==" }, "p-defer": { "version": "3.0.0", @@ -28255,7 +28745,7 @@ "p-locate": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", "requires": { "p-limit": "^1.1.0" } @@ -28271,7 +28761,7 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==" }, "param-case": { "version": "3.0.4", @@ -28299,7 +28789,7 @@ "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "requires": { "error-ex": "^1.2.0" } @@ -28350,7 +28840,7 @@ "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "requires": { "graceful-fs": "^4.1.6" } @@ -28387,7 +28877,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==" }, "path-is-absolute": { "version": "1.0.1" @@ -28395,7 +28885,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==" }, "path-parse": { "version": "1.0.7", @@ -28405,7 +28895,7 @@ "path-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "requires": { "graceful-fs": "^4.1.2", "pify": "^2.0.0", @@ -28430,7 +28920,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==" }, "picomatch": { "version": "2.3.1" @@ -28438,17 +28928,17 @@ "pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" }, "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==" }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", "requires": { "pinkie": "^2.0.0" } @@ -28459,9 +28949,9 @@ "integrity": "sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==" }, "prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==" + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==" }, "protobufjs": { "version": "6.11.2", @@ -28486,12 +28976,12 @@ "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" }, "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "punycode": { "version": "2.1.0" @@ -28502,9 +28992,9 @@ "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==" }, "qs": { - "version": "6.10.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz", - "integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==", + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "requires": { "side-channel": "^1.0.4" } @@ -28521,7 +29011,7 @@ "querystring": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", - "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==" }, "ramda": { "version": "0.27.2", @@ -28556,7 +29046,7 @@ "read-pkg": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "requires": { "load-json-file": "^1.0.0", "normalize-package-data": "^2.3.2", @@ -28566,7 +29056,7 @@ "read-pkg-up": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "requires": { "find-up": "^1.0.0", "read-pkg": "^1.0.0" @@ -28575,7 +29065,7 @@ "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "requires": { "path-exists": "^2.0.0", "pinkie-promise": "^2.0.0" @@ -28584,7 +29074,7 @@ "path-exists": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "requires": { "pinkie-promise": "^2.0.0" } @@ -28667,7 +29157,7 @@ "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" }, "resolve": { "version": "1.17.0", @@ -28706,9 +29196,9 @@ }, "dependencies": { "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" } } }, @@ -28741,7 +29231,7 @@ "scryptsy": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", - "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", + "integrity": "sha512-aldIRgMozSJ/Gl6K6qmJZysRP82lz83Wb42vl4PWN8SaLFHIaOzLPc9nUUW2jQN88CuGm5q5HefJ9jZ3nWSmTw==", "requires": { "pbkdf2": "^3.0.3" } @@ -28766,7 +29256,7 @@ "semaphore-async-await": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha1-hXvvXjZEYBykuVcLh+nfXKEpdPo=" + "integrity": "sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==" }, "semver": { "version": "6.3.0", @@ -28790,12 +29280,12 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" }, "setprototypeof": { "version": "1.2.0", @@ -28815,7 +29305,7 @@ "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", "requires": { "shebang-regex": "^1.0.0" } @@ -28823,7 +29313,7 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==" }, "side-channel": { "version": "1.0.4", @@ -28938,7 +29428,7 @@ "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", - "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "integrity": "sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA==", "requires": { "graceful-fs": "^4.1.2", "jsonfile": "^2.1.0", @@ -28950,7 +29440,7 @@ "jsonfile": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", "requires": { "graceful-fs": "^4.1.6" } @@ -29032,7 +29522,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==" } } }, @@ -29112,7 +29602,7 @@ "strip-bom": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", "requires": { "is-utf8": "^0.2.0" } @@ -29120,7 +29610,7 @@ "strip-hex-prefix": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", "requires": { "is-hex-prefixed": "1.0.0" } @@ -29139,7 +29629,7 @@ "test-value": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha1-Edpv9nDzRxpztiXKTz/c97t0gpE=", + "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", "requires": { "array-back": "^1.0.3", "typical": "^2.6.0" @@ -29148,7 +29638,7 @@ "array-back": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha1-ZEun8JX3/898Q7Xw3DnTwfA8Bjs=", + "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", "requires": { "typical": "^2.6.0" } @@ -29256,12 +29746,12 @@ "tsort": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", - "integrity": "sha1-4igPXoF/i/QnVlf9D5rr1E9aJ4Y=" + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==" }, "tunnel-agent": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", "requires": { "safe-buffer": "^5.0.1" } @@ -29317,7 +29807,7 @@ "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", "requires": { "graceful-fs": "^4.1.6" } @@ -29349,7 +29839,7 @@ "typical": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=" + "integrity": "sha512-ofhi8kjIje6npGozTip9Fr8iecmYfEbS06i0JnIg+rh51KakryWF4+jX8lLKZVhy6N+ID45WYSFCxPOdTWCzNg==" }, "uint8arrays": { "version": "2.1.10", @@ -29367,9 +29857,9 @@ } }, "undici": { - "version": "4.16.0", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.16.0.tgz", - "integrity": "sha512-tkZSECUYi+/T1i4u+4+lwZmQgLXd4BLGlrc7KZPcLIW7Jpq99+Xpc30ONv7nS6F5UNOxp/HBZSSL9MafUrvJbw==" + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.8.0.tgz", + "integrity": "sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q==" }, "unique-random": { "version": "3.0.0" @@ -29387,7 +29877,7 @@ "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" }, "upper-case": { "version": "2.0.2", @@ -29410,7 +29900,7 @@ "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", - "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "integrity": "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ==", "requires": { "punycode": "1.3.2", "querystring": "0.2.0" @@ -29419,7 +29909,7 @@ "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", - "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==" } } }, @@ -29465,7 +29955,7 @@ "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -29493,11 +29983,11 @@ } }, "web3-utils": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.3.tgz", - "integrity": "sha512-g6nQgvb/bUpVUIxJE+ezVN+rYwYmlFyMvMIRSuqpi1dk6ApDD00YNArrk7sPcZnjvxOJ76813Xs2vIN2rgh4lg==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.7.4.tgz", + "integrity": "sha512-acBdm6Evd0TEZRnChM/MCvGsMwYKmSh7OaUfNf5OKG0CIeGWD/6gqLOWIwmwSnre/2WrA1nKGId5uW2e5EfluA==", "requires": { - "bn.js": "^4.11.9", + "bn.js": "^5.2.1", "ethereum-bloom-filters": "^1.0.6", "ethereumjs-util": "^7.1.0", "ethjs-unit": "0.1.6", @@ -29506,23 +29996,21 @@ "utf8": "3.0.0" }, "dependencies": { + "bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" + }, "ethereumjs-util": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.4.tgz", - "integrity": "sha512-p6KmuPCX4mZIqsQzXfmSx9Y0l2hqf+VkAiwSisW3UKUFdk8ZkAt+AYaor83z2nSi6CU2zSsXMlD80hAbNEGM0A==", + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", "requires": { "@types/bn.js": "^5.1.0", "bn.js": "^5.1.2", "create-hash": "^1.1.2", "ethereum-cryptography": "^0.1.3", "rlp": "^2.2.4" - }, - "dependencies": { - "bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - } } } } @@ -29546,7 +30034,7 @@ "which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ==" }, "which-typed-array": { "version": "1.1.7", @@ -29562,7 +30050,7 @@ "window-size": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" + "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==" }, "workerpool": { "version": "6.2.0", diff --git a/package.json b/package.json index 5967dcf..20e1e10 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@safient/core", - "version": "0.1.19-alpha.1", + "version": "0.1.20-alpha", "description": "JavaScript SDK to manage safes and interact with Safient protocol.", "keywords": [ "Web3", @@ -37,7 +37,7 @@ "@ceramicstudio/idx": "^0.12.0", "@ceramicstudio/idx-tools": "^0.10.0", "@ethersproject/providers": "^5.4.4", - "@safient/contracts": "^0.1.16-alpha", + "@safient/contracts": "^0.1.17-alpha", "@stablelib/random": "^1.0.1", "@textile/hub": "^6.3.1", "bcryptjs": "^2.4.3", diff --git a/src/SafientCore.ts b/src/SafientCore.ts index 662e3d4..d1b7988 100644 --- a/src/SafientCore.ts +++ b/src/SafientCore.ts @@ -1,17 +1,20 @@ -import { IDX } from '@ceramicstudio/idx'; -import { JsonRpcProvider, TransactionReceipt, TransactionResponse } from '@ethersproject/providers'; -import { SafientMain, Arbitrator, Types } from '@safient/contracts'; -import { BigNumber, ethers, providers } from 'ethers'; +import { IDX } from "@ceramicstudio/idx"; +import { + JsonRpcProvider, + Provider, + TransactionReceipt, + TransactionResponse, +} from "@ethersproject/providers"; +import { SafientMain, Arbitrator, Types } from "@safient/contracts"; +import { BigNumber, ethers, providers } from "ethers"; import { Connection, User, UserMeta, Safe, - SafeCreation, Share, SafeEncrypted, - UserSchema, Utils, Signer, UserResponse, @@ -23,8 +26,8 @@ import { CeramicDefintions, ClaimResponse, EventResponse, -} from './lib/types'; -import { definitions } from './utils/config.json'; +} from "./lib/types"; +import { definitions } from "./utils/config.json"; import { createClaimEvidenceUri, createMetaData, @@ -41,15 +44,20 @@ import { deleteDecShard, updateDecShard, getDecShards, -} from './logic/index'; -import { Database } from './database'; -import { Crypto } from './crypto'; -import { Auth, Signature } from './identity'; -import { ClaimStages, DatabaseType, NetworkType, SafeStages } from './lib/enums'; -import { Networks } from './utils/networks'; -import {SafientResponse} from './lib/services' -import {Errors} from "./lib/errors" -require('dotenv').config(); +} from "./logic/index"; +import { Database } from "./database"; +import { Crypto } from "./crypto"; +import { Auth, Signature } from "./identity"; +import { + ClaimStages, + DatabaseType, + NetworkType, + SafeStages, +} from "./lib/enums"; +import { Networks } from "./utils/networks"; +import { SafientResponse } from "./lib/services"; +import { Errors } from "./lib/errors"; +require("dotenv").config(); export class SafientCore { /** @ignore */ @@ -59,6 +67,8 @@ export class SafientCore { /**@ignore */ private arbitrator: Arbitrator; /** @ignore */ + private userData: User; + /** @ignore */ private connection: Connection; /** @ignore */ private crypto: Crypto; @@ -81,122 +91,161 @@ export class SafientCore { /**@ignore */ private chainId: number; /**@ignore */ - private CERAMIC_URL: string + private CERAMIC_URL: string; /**@ignore */ - private ceramicDefintions: CeramicDefintions + private ceramicDefintions: CeramicDefintions; /**@ignore */ private guardianFee: number = 0.05; - /** * Constructor to initilize the Core SDK - * @param signer Signer object of the wallet + * @param signer Signer object of the provider for user authentication * @param network The type of network from NetworkType Enum - * @param databaseType Type of database to use - * @param databaseAPIKey Database API key - * @param databaseAPISecret Database API secret - * @param threadId ThreadDB ID if its available (optional) + * @param databaseType Type of database to use (Optional) + * @param databaseAPIKey Database API key (Optional) + * @param databaseAPISecret Database API secret (Optional) + * @param threadId ThreadDB ID if its available (Optional) */ constructor( - signer: Signer, - network: NetworkType, - databaseType: DatabaseType, - databaseAPIKey: any, - databaseAPISecret: any, + network: NetworkType = NetworkType.testnet, + databaseType: DatabaseType = DatabaseType.threadDB, + databaseAPIKey?: any, + databaseAPISecret?: any, threadId?: number[] ) { - - this.signer = signer; this.chainId = Networks[network].chainId; - this.CERAMIC_URL = Networks[network].ceramic.CERAMIC_URL - this.ceramicDefintions = Networks[network].ceramic.config + this.CERAMIC_URL = Networks[network].ceramic.CERAMIC_URL; + this.ceramicDefintions = Networks[network].ceramic.config; if (!threadId) { this.threadId = Networks[network].threadId; } else { this.threadId = threadId!; } - this.contract = new SafientMain(signer, this.chainId); - this.arbitrator = new Arbitrator(signer, this.chainId); + this.apiKey = databaseAPIKey; this.apiSecret = databaseAPISecret; this.databaseType = databaseType; this.auth = new Auth(); - this.signature = new Signature(signer); } /** - * This API generates user ceramic and database connection object + * @param signer Signer object of the provider for user authentication * @returns Connection datatype */ - loginUser = async (): Promise> => { + loginUser = async (signer: Signer): Promise> => { try { + this.signer = signer; + this.signature = new Signature(signer); + this.contract = new SafientMain(signer, this.chainId); + this.arbitrator = new Arbitrator(signer, this.chainId); const seed = await this.signature.sign(); - const { idx, ceramic } = await this.auth.generateIdentity(Uint8Array.from(seed), this.CERAMIC_URL, this.ceramicDefintions); - const { client, threadId } = await this.auth.generateThread(seed, this.apiKey, this.apiSecret, this.threadId); + const { idx } = await this.auth.generateIdentity( + Uint8Array.from(seed), + this.CERAMIC_URL, + this.ceramicDefintions + ); + const { client, threadId } = await this.auth.generateThread( + seed, + this.apiKey, + this.apiSecret, + this.threadId + ); const connectionData = { client, threadId, idx }; this.connection = connectionData; this.Utils = init(this.databaseType, this.connection); this.crypto = this.Utils.crypto; this.database = this.Utils.database; - const userData: SafientResponse = await this.getUser({ did: idx?.id }); + const userData: SafientResponse = await this.getUser({ + did: idx?.id, + }); if (userData.data) { - return userData + this.userData = userData.data; + return userData; } else { - throw new SafientResponse({error: Errors.UserNotFound}) + throw new SafientResponse({ error: Errors.UserNotFound }); } } catch (err) { - if(err instanceof SafientResponse){ - throw new SafientResponse({error: err.error}); - }else{ - const {message} = err as Error - throw new SafientResponse({error: {code: 0 , message: message}}); + if (err instanceof SafientResponse) { + throw new SafientResponse({ error: err.error }); + } else { + const { message } = err as Error; + throw new SafientResponse({ error: { code: 0, message: message } }); } } }; /** * This API registers users onto the platform - * @param name Name of the user - * @param email Email of the user - * @param signUpMode Signup mode (0 - Metamask, 1 - Social Login) - * @param userAddress Metamask address of the user + * @param signer Signer object of the provider for user authentication + * @param details.name Name of the user (Optional) + * @param details.email Email of the user (Optional) + * @param guardian If the user is a guardian * @returns User registration ID */ - createUser = async (name: string, email: string, signUpMode: number, userAddress: string, guardian: boolean): Promise> => { - try { - + createUser = async ( + signer: Signer, + details?: {name: string, email: string}, + guardian: boolean = false, + ): Promise> => { + + this.signer = signer; + this.signature = new Signature(signer); + const userAddress = await signer.getAddress(); + const seed = await this.signature.sign(); + const { idx } = await this.auth.generateIdentity( + Uint8Array.from(seed), + this.CERAMIC_URL, + this.ceramicDefintions + ); + const { client, threadId } = await this.auth.generateThread( + seed, + this.apiKey, + this.apiSecret, + this.threadId + ); + const connectionData = { client, threadId, idx }; + this.connection = connectionData; + this.Utils = init(this.databaseType, this.connection); + this.crypto = this.Utils.crypto; + this.database = this.Utils.database; + try { let idx: IDX | null = this.connection.idx; - let did: string = idx?.id || ''; + let did: string = idx?.id || ""; - const data: UserSchema = { + const data: User = { + _id: '', did, - name, - email, + name: details?.name, + email: details?.email, safes: [], - signUpMode, userAddress, - guardian + guardian, }; - const result: UserResponse = await createUser(data, this.connection.idx?.id!); + const result: UserResponse = await createUser( + data, + this.connection.idx?.id! + ); if (result.status === false) { - const ceramicResult = await idx?.set(this.ceramicDefintions.definitions.profile, { - name: name, - email: email, - }); - return new SafientResponse({data: result.data!}) + const ceramicResult = await idx?.set( + this.ceramicDefintions.definitions.profile, + { + name: details?.name, + email: details?.email, + } + ); + return new SafientResponse({ data: result.data! }); } else { - throw new SafientResponse({error: Errors.UserAlreadyExists}) + throw new SafientResponse({ error: Errors.UserAlreadyExists }); } - } catch (err) { - if(err instanceof SafientResponse){ - throw new SafientResponse({error: err.error}); - }else{ - const {message} = err as Error - throw new SafientResponse({error: {code: 0 , message: message}}); + if (err instanceof SafientResponse) { + throw new SafientResponse({ error: err.error }); + } else { + const { message } = err as Error; + throw new SafientResponse({ error: { code: Errors.CommonError.code, message: message } }); } } }; @@ -206,9 +255,11 @@ export class SafientCore { * @param obj Takes email or did as parameter to get the user information * @returns User or null based on user information present */ - getUser = async (obj: { email?: string; did?: string }): Promise> => { + getUser = async (obj: { + email?: string; + did?: string; + }): Promise> => { try { - let user: User | null = null; if (obj.did) { user = await getUser({ did: obj.did }); @@ -216,16 +267,16 @@ export class SafientCore { user = await getUser({ email: obj.email }); } if (user) { - return new SafientResponse({data: user}) + return new SafientResponse({ data: user }); } else { - throw new SafientResponse({error: Errors.UserNotFound}) + throw new SafientResponse({ error: Errors.UserNotFound }); } } catch (err) { - if(err instanceof SafientResponse){ - throw new SafientResponse({error: err.error}); - }else{ - const {message} = err as Error - throw new SafientResponse({error: {code: 0 , message: message}}); + if (err instanceof SafientResponse) { + throw new SafientResponse({ error: err.error }); + } else { + const { message } = err as Error; + throw new SafientResponse({ error: { code: 0, message: message } }); } } }; @@ -237,10 +288,10 @@ export class SafientCore { getUsers = async (): Promise> => { try { const users: UserMeta[] = await getUsers(); - return new SafientResponse({data: users}); + return new SafientResponse({ data: users }); } catch (err) { - const {message} = err as Error - throw new SafientResponse({error: {code: 0 , message: message}}); + const { message } = err as Error; + throw new SafientResponse({ error: { code: 0, message: message } }); } }; @@ -251,9 +302,15 @@ export class SafientCore { * @param beneficiaryDID DID of the safe beneficiary * @returns Array of guardian DIDs */ - private randomGuardians = async (creatorDID: string | any, beneficiaryDID: string | any): Promise => { + private randomGuardians = async ( + creatorDID: string | any, + beneficiaryDID: string | any + ): Promise => { try { - const guardians: User[] = await generateRandomGuardians(creatorDID, beneficiaryDID); + const guardians: User[] = await generateRandomGuardians( + creatorDID, + beneficiaryDID + ); return guardians; } catch (err) { throw new Error(`Couldn't fetch random guardians, ${err}`); @@ -262,225 +319,241 @@ export class SafientCore { /** * This API is used to create a safe either onChain or offChain - * @param creatorDID DID of the user who creates the safe - * @param beneficiaryDID DID of the user who inherits the safe + * @param beneficiary.did DID of the user who inherits/ claims the safe + * @param beneficiary.email Email of the user who inherits/ claims the safe * @param safeData Data being stored in the safe - * @param onChain The data to be stored onChain or offChain - * @param claimType The safe is claimed through either "Arbitration" or "Signal" (Arbitration - 0, Signal - 1) - * @param signalingPeriod signalingPeriod The time window in seconds within which the creator wants to signal the safe in response to a claim on the safe - * @param dDay The timestamp in unix epoch milliseconds after which the beneficiary can directly claim the safe + * @param onChain The data to be stored onChain or offChain while creating the safe + * @param persist Flag to replicate the safe metadata to IPFS + * @param claimDetails.type The claim type to recover the safe of type ClaimType + * @param claimDetails.period signaling period or dDay timestamp for the claim * @returns ID generated for the Safe */ createSafe = async ( - safeName: string, - description: string, - creatorDID: string, safeData: SafeStore, - onChain: boolean, - claimType: number, - signalingPeriod: number, - dDay: number, - beneficiary: { email?: string, did?: string}, - persist: boolean = false, + beneficiary?: { email?: string; did?: string }, + claimDetails?: { type: number; period: number }, + safeDetails?: { name?: string; description?: string }, + onChain: boolean = false, + persist: boolean = false ): Promise> => { try { - let guardians: User[] = []; let beneficiaryUser: User | null = null; let txReceipt: TransactionReceipt | undefined; - const guardiansDid: string[] = [] + const guardiansDid: string[] = []; //userQueryDid function - const creatorUser: User[] = await queryUserDid(creatorDID); - const beneficiaryResult: SafientResponse = await this.getUser(beneficiary) - beneficiaryUser = beneficiaryResult.data! - - guardians = await this.randomGuardians(creatorDID, beneficiaryUser.did); - if(creatorDID !== beneficiaryUser._id){ - if (guardians.length === 3) { - const secretsData = this.crypto.generateSecrets(guardians); - guardians.map(guardian => guardiansDid.push(guardian.did) ) - //note 1: Change here - const signature: string = await this.signer.signMessage(ethers.utils.arrayify(secretsData.hash)); - - const encryptedSafeData: SafeEncrypted = await this.crypto.encryptSafeData( - safeData, - beneficiaryUser!.did, - this.connection.idx?.id, - this.connection, - guardiansDid, - signature, - secretsData.recoveryMessage, - secretsData.secrets + // const creatorUser: User[] = await queryUserDid(creatorDID); + const signalPeriod = claimDetails? (claimDetails.type == 0 ? claimDetails.period : 0) : 0; + const dDay = claimDetails? (claimDetails.type == 2 ? claimDetails.period : 0) : 0; + const isBeneficiary = typeof beneficiary == 'object' && beneficiary ? Object.keys(beneficiary).length : false + + if (isBeneficiary && beneficiary) { + const beneficiaryResult: SafientResponse = await this.getUser( + beneficiary + ); + beneficiaryUser = beneficiaryResult.data!; + + + guardians = await this.randomGuardians( + this.userData.did, + beneficiaryUser.did + ); + if (this.userData.did == beneficiaryUser._id) { + throw new SafientResponse({ error: Errors.SelfSafeCreation }); + } + + if (guardians.length !== 3) { + throw new SafientResponse({ error: Errors.SafeNotCreated }); + } + } + + const secretsData = this.crypto.generateSecrets(guardians); + guardians.map((guardian) => guardiansDid.push(guardian.did)); + //note 1: Change here + const signature: string = await this.signer.signMessage( + ethers.utils.arrayify(secretsData.hash) + ); + + const encryptedSafeData: SafeEncrypted = + await this.crypto.encryptSafeData( + safeData, + this.connection.idx?.id, + this.connection, + guardiansDid, + signature, + secretsData.recoveryMessage, + secretsData.secrets, + beneficiaryUser?.did, + ); + + const safeLinkData: SafeLink = { + creator: this.connection.idx?.id!, + guardians: guardiansDid, + beneficiary: beneficiaryUser ? beneficiaryUser.did : null, + encSafeKey: encryptedSafeData.creatorEncKey, + encSafeData: encryptedSafeData.encryptedData, + encSafeKeyShards: encryptedSafeData.shardData, + onChain: onChain, + claimType: claimDetails ? claimDetails?.type : null, + signalingPeriod: signalPeriod, + dDay: dDay, + timeStamp: Date.now(), + }; + + const safeLink = persist ? await createIpfsSafeLink(safeLinkData) : null; + + const data: Safe = { + _id: '', + safeName: safeDetails?.name, + description: safeDetails?.description, + creator: this.connection.idx!.id, + guardians: guardiansDid, + beneficiary: beneficiaryUser? beneficiaryUser?.did : null, + encSafeKey: encryptedSafeData.creatorEncKey, + beneficiaryEncSafeKey: claimDetails ? null : encryptedSafeData.beneficiaryEncKey, + encSafeData: encryptedSafeData.encryptedData, + stage: SafeStages.ACTIVE, + encSafeKeyShards: encryptedSafeData.shardData, + decSafeKeyShards: [], + claims: [], + onChain: onChain, + claimType: claimDetails ? claimDetails?.type : null, + signalingPeriod: signalPeriod, + dDay: dDay, + timeStamp: Date.now(), + proofSubmission: false, + cid: safeLink, + }; + + + const safe: string[] = await createSafe(data); + + if (onChain === true && claimDetails && beneficiaryUser) { + let totalFee: number = this.guardianFee; + let metaDataEvidenceUri: string = ""; + if (claimDetails?.type === Types.ClaimType.ArbitrationBased) { + const arbitrationFee: number = + await this.arbitrator.getArbitrationFee(); + totalFee = totalFee + arbitrationFee; + + metaDataEvidenceUri = await createMetaData( + "", + this.userData.userAddress ); + } - const safeLinkData: SafeLink = { - creator: this.connection.idx?.id!, - guardians: guardiansDid, - beneficiary: beneficiaryUser.did, - encSafeKey: encryptedSafeData.creatorEncKey, - encSafeData: encryptedSafeData.encryptedData, - encSafeKeyShards: encryptedSafeData.shardData, - onChain: onChain, - claimType: claimType, - signalingPeriod: signalingPeriod, - dDay: dDay, - timeStamp: Date.now() - } - - const safeLink = persist ? await createIpfsSafeLink(safeLinkData) : null; - - - const data: SafeCreation = { - safeName: safeName, - description: description, - creator: this.connection.idx?.id, - guardians: guardiansDid, - beneficiary: beneficiaryUser?.did, - encSafeKey: encryptedSafeData.creatorEncKey, - encSafeData: encryptedSafeData.encryptedData, - stage: SafeStages.ACTIVE, - encSafeKeyShards: encryptedSafeData.shardData, - claims: [], - onChain: onChain, - claimType: claimType, - signalingPeriod: signalingPeriod, - dDay: dDay, - timeStamp: Date.now(), - proofSubmission: false, - cid: safeLink - }; - - const safe: string[] = await createSafe(data); - - if (onChain === true) { - - if (claimType === Types.ClaimType.ArbitrationBased) { - const arbitrationFee: number = await this.arbitrator.getArbitrationFee(); - const metaDataEvidenceUri: string = await createMetaData( - '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', - creatorUser[0].userAddress - ); - const totalFee: string = String(ethers.utils.parseEther(String(arbitrationFee + this.guardianFee))); - const tx: TransactionResponse = await this.contract.createSafe( - beneficiaryUser!.userAddress, - safe[0], - claimType, - signalingPeriod, - dDay, - metaDataEvidenceUri, - totalFee - ); - txReceipt = await tx.wait(); - } else if (claimType === Types.ClaimType.SignalBased || claimType === Types.ClaimType.DDayBased) { - - const totalFee: string = String(ethers.utils.parseEther(String(this.guardianFee))); - - - const tx: TransactionResponse = await this.contract.createSafe( - beneficiaryUser!.userAddress, - safe[0], - claimType, - signalingPeriod, - dDay, - '', - totalFee - ); //NOTE: Change the time from 1 to required period here - txReceipt = await tx.wait(); - } - } - - if (txReceipt?.status === 1 || onChain === false) { - if (creatorUser[0].safes.length === 0) { - creatorUser[0].safes = [ - { - safeName: safeName, - safeId: safe[0], - type: 'creator', - decShard: null - }, - ]; - } else { - creatorUser[0].safes.push({ - safeName: safeName, - safeId: safe[0], - type: 'creator', - decShard: null - }); - } - - if (beneficiaryUser!.safes.length === 0) { - beneficiaryUser!.safes = [ - { - safeName: safeName, - safeId: safe[0], - type: 'beneficiary', - decShard: null - }, - ]; - } else { - beneficiaryUser!.safes.push({ - safeName: safeName, + const tx: TransactionResponse = await this.contract.createSafe( + beneficiaryUser.userAddress, + safe[0], + claimDetails?.type, + signalPeriod, + dDay, + metaDataEvidenceUri, + String(ethers.utils.parseEther(String(totalFee))) + ); //NOTE: Change the time from 1 to required period here + txReceipt = await tx.wait(); + } + + if (txReceipt?.status === 1 || onChain === false) { + if (this.userData.safes.length === 0) { + this.userData.safes = [ + { + safeName: safeDetails?.name, + safeId: safe[0], + type: "creator", + decShard: null, + }, + ]; + } else { + this.userData.safes.push({ + safeName: safeDetails?.name, + safeId: safe[0], + type: "creator", + decShard: null, + }); + } + + await this.database.save(this.userData, "Users"); + + // only for beneficiary + + if (isBeneficiary && beneficiary) { + + if (beneficiaryUser!.safes.length === 0) { + beneficiaryUser!.safes = [ + { + safeName: safeDetails?.name, + safeId: safe[0], + type: "beneficiary", + decShard: null, + }, + ]; + } else { + beneficiaryUser!.safes.push({ + safeName: safeDetails?.name, + safeId: safe[0], + type: "beneficiary", + decShard: null, + }); + } + + for ( + let guardianIndex = 0; + guardianIndex < guardiansDid.length; + guardianIndex++ + ) { + if (guardians[guardianIndex].safes.length === 0) { + guardians[guardianIndex].safes = [ + { + safeName: safeDetails?.name, safeId: safe[0], - type: 'beneficiary', - decShard: null - }); - } - - for (let guardianIndex = 0; guardianIndex < guardiansDid.length; guardianIndex++) { - if (guardians[guardianIndex].safes.length === 0) { - guardians[guardianIndex].safes = [ - { - safeName: safeName, - safeId: safe[0], - type: 'guardian', - decShard: null - }, - ]; - } else { - guardians[guardianIndex].safes.push({ - safeName: safeName, - safeId: safe[0], - type: 'guardian', - decShard: null - }); - } - } - - await this.database.save(creatorUser[0], 'Users'); - await this.database.save(beneficiaryUser, 'Users'); - - for (let guardianIndex = 0; guardianIndex < guardiansDid.length; guardianIndex++) { - await this.database.save(guardians[guardianIndex], 'Users'); - } - } - - if (txReceipt?.status === 0) { - await this.database.delete(safe[0], 'Users'); - console.log('Transaction Failed!'); - throw new SafientResponse({error: Errors.TransactionFailure}) - } - const result: EventResponse = { - id: safe[0], - recepient: { - name: beneficiaryUser!.name, - email: beneficiaryUser!.email, - phone: '', - } + type: "guardian", + decShard: null, + }, + ]; + } else { + guardians[guardianIndex].safes.push({ + safeName: safeDetails?.name, + safeId: safe[0], + type: "guardian", + decShard: null, + }); } - return new SafientResponse({data: result}) - } else { - throw new SafientResponse({error: Errors.SafeNotCreated}) + } + await this.database.save(beneficiaryUser, "Users"); + + for ( + let guardianIndex = 0; + guardianIndex < guardiansDid.length; + guardianIndex++ + ) { + await this.database.save(guardians[guardianIndex], "Users"); } - }else{ - throw new SafientResponse({error: Errors.SelfSafeCreation}) } - + } + + if (txReceipt?.status === 0) { + + // Delete the safe if onchain safe creation fails + await this.database.delete(safe[0], "Users"); + throw new SafientResponse({ error: Errors.TransactionFailure }); + } + + const result: EventResponse = { + id: safe[0], + recepient: { + name: beneficiaryUser?.name, + email: beneficiaryUser?.email, + phone: "", + }, + }; + return new SafientResponse({ data: result }); } catch (err) { - if(err instanceof SafientResponse){ - throw new SafientResponse({error: err.error}); - }else{ - const {message} = err as Error - throw new SafientResponse({error: {code: 0 , message: message}}); + if (err instanceof SafientResponse) { + throw new SafientResponse({ error: err.error }); + } else { + const { message } = err as Error; + throw new SafientResponse({ error: { code: 0, message: message } }); } } }; @@ -491,35 +564,44 @@ export class SafientCore { * @returns Encrypted Safe Data */ getSafe = async (safeId: string): Promise> => { - try { + try { const result: Safe = await getSafeData(safeId); // TODO: Need to move the different function - if(result.stage === SafeStages.CLAIMING){ - const claimStatus = await this.getClaimStatus(safeId, result.claims[result.claims.length - 1].disputeId) - result.claims[result.claims.length - 1].claimStatus = claimStatus - if(claimStatus === ClaimStages.PASSED){ - result.stage = SafeStages.RECOVERING - }else if(claimStatus === ClaimStages.FAILED || claimStatus === ClaimStages.REJECTED){ - result.stage = SafeStages.ACTIVE + if (result.stage === SafeStages.CLAIMING) { + const claimStatus = await this.getClaimStatus( + safeId, + result.claims[result.claims.length - 1].disputeId + ); + result.claims[result.claims.length - 1].claimStatus = claimStatus; + if (claimStatus === ClaimStages.PASSED) { + result.stage = SafeStages.RECOVERING; + } else if ( + claimStatus === ClaimStages.FAILED || + claimStatus === ClaimStages.REJECTED + ) { + result.stage = SafeStages.ACTIVE; } } - return new SafientResponse({data: result}); + return new SafientResponse({ data: result }); } catch (err) { - throw new SafientResponse({error: Errors.SafeNotFound}) + throw new SafientResponse({ error: Errors.SafeNotFound }); } }; /** * This API allows for safe claiming for the beneficiary * @param safeId ID of the safe being claimed - * @param file Evidence submitted with the claim - * @param evidenceName Name of the evidence - * @param description Decscription of the evidence and claim being submitted + * @param details.file Evidence submitted with the claim (Application only for Arbitration based claims) + * @param details.evidenceName Name of the evidence (Application only for Arbitration based claims) + * @param details.description Decscription of the evidence and claim being submitted (Application only for Arbitration based claims) * @returns Dispute Number generated for the claim */ - createClaim = async (safeId: string, file: any, evidenceName: string, description: string): Promise> => { + createClaim = async ( + safeId: string, + details?: { file: any; evidenceName: string; description: string } + ): Promise> => { try { - let evidenceUri: string = ''; + let evidenceUri: string = ""; let tx: TransactionResponse; let disputeId: number = 0; let txReceipt: any; @@ -527,43 +609,57 @@ export class SafientCore { let createSafetxReceipt: any; let dispute: any; let timeStamp: number = 0; - const userBalance: BigNumber = await this.signer.getBalance() - let etherBalance = ethers.utils.formatEther(userBalance) + const userBalance: BigNumber = await this.signer.getBalance(); + let etherBalance = ethers.utils.formatEther(userBalance); + const file = details?.file + const evidenceName = details?.evidenceName? details?.evidenceName : ''; + const description = details?.description? details?.description : ''; let safeData: SafientResponse = await this.getSafe(safeId); const safe = safeData.data!; let creatorUser: User[] = await queryUserDid(safe.creator); - - if(parseFloat(etherBalance) >= 0.1){ - if (safe.onChain === true ) { + + if (parseFloat(etherBalance) >= 0.1) { + if (safe.onChain === true) { if (safe.claimType === Types.ClaimType.ArbitrationBased) { if (safe.stage === SafeStages.ACTIVE) { - evidenceUri = await createClaimEvidenceUri(file, evidenceName, description); + // Fix the metadata and IPFS stores + // evidenceUri = await createClaimEvidenceUri( + // file, + // evidenceName, + // description + // ); + evidenceUri = ''; tx = await this.contract.createClaim(safe._id, evidenceUri); txReceipt = await tx.wait(); } } else if (safe.claimType === Types.ClaimType.SignalBased) { if (safe.stage === SafeStages.ACTIVE) { - tx = await this.contract.createClaim(safe._id, ''); + tx = await this.contract.createClaim(safe._id, ""); txReceipt = await tx.wait(); } } else if (safe.claimType === Types.ClaimType.DDayBased) { - tx = await this.contract.createClaim(safe._id, ''); + tx = await this.contract.createClaim(safe._id, ""); txReceipt = await tx.wait(); } } - + if (safe.onChain === false) { - - if (safe.claimType === Types.ClaimType.ArbitrationBased) { - const metaDataEvidenceUri: string = await createMetaData( - '0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512', - creatorUser[0].userAddress - ); + // Fix the metadata and IPFS stores + // const metaDataEvidenceUri: string = await createMetaData( + // "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", + // creatorUser[0].userAddress + // ); + const metaDataEvidenceUri = ''; if (safe.stage === SafeStages.ACTIVE) { - const arbitrationFee: number = await this.arbitrator.getArbitrationFee(); - const totalFee: string = String(ethers.utils.parseEther(String(arbitrationFee + this.guardianFee))); + const arbitrationFee: number = + await this.arbitrator.getArbitrationFee(); + const totalFee: string = String( + ethers.utils.parseEther( + String(arbitrationFee + this.guardianFee) + ) + ); createSafetx = await this.contract.syncSafe( creatorUser[0].userAddress, safeId, @@ -577,71 +673,81 @@ export class SafientCore { } } else if (safe.claimType === Types.ClaimType.SignalBased) { if (safe.stage === SafeStages.ACTIVE) { - const totalFee: string = String(ethers.utils.parseEther(String(this.guardianFee))); + const totalFee: string = String( + ethers.utils.parseEther(String(this.guardianFee)) + ); createSafetx = await this.contract.syncSafe( creatorUser[0].userAddress, safeId, safe.claimType, safe.signalingPeriod, safe.dDay, - '', + "", totalFee ); //Note update time here createSafetxReceipt = await createSafetx.wait(); } } else if (safe.claimType === Types.ClaimType.DDayBased) { - const totalFee: string = String(ethers.utils.parseEther(String(this.guardianFee))); + const totalFee: string = String( + ethers.utils.parseEther(String(this.guardianFee)) + ); createSafetx = await this.contract.syncSafe( creatorUser[0].userAddress, safeId, safe.claimType, safe.signalingPeriod, safe.dDay, - '', + "", totalFee ); //Note update time here createSafetxReceipt = await createSafetx.wait(); } - + if (createSafetxReceipt.status === 1) { if (safe.claimType === Types.ClaimType.ArbitrationBased) { - evidenceUri = await createClaimEvidenceUri(file, evidenceName, description); + // Fix the metadata and IPFS stores + // evidenceUri = await createClaimEvidenceUri( + // file, + // evidenceName, + // description + // ); + evidenceUri = ''; tx = await this.contract.createClaim(safe._id, evidenceUri); } else { - tx = await this.contract.createClaim(safe._id, ''); + tx = await this.contract.createClaim(safe._id, ""); } txReceipt = await tx.wait(); } } - + if (txReceipt.status === 1) { if (safe.claimType === Types.ClaimType.ArbitrationBased) { if (safe.stage === SafeStages.ACTIVE) { dispute = txReceipt.events[2].args[1]; - timeStamp = parseInt(txReceipt.events[2].args[2]._hex) + timeStamp = parseInt(txReceipt.events[2].args[2]._hex); disputeId = parseInt(dispute._hex); } } else if (safe.claimType === Types.ClaimType.SignalBased) { if (safe.stage === SafeStages.ACTIVE) { dispute = txReceipt.events[0].args[1]; - timeStamp = parseInt(txReceipt.events[0].args[2]._hex) + timeStamp = parseInt(txReceipt.events[0].args[2]._hex); disputeId = parseInt(dispute._hex); } } else if (safe.claimType === Types.ClaimType.DDayBased) { dispute = txReceipt.events[0].args[1]; - timeStamp = parseInt(txReceipt.events[0].args[2]._hex) + timeStamp = parseInt(txReceipt.events[0].args[2]._hex); disputeId = parseInt(dispute._hex); } - + safe.stage = SafeStages.CLAIMING; - + if (safe.claims.length === 0) { safe.claims = [ { createdBy: this.connection.idx?.id, claimStatus: ClaimStages.ACTIVE, disputeId: disputeId, - timeStamp: timeStamp + timeStamp: timeStamp, }, ]; } else { @@ -649,72 +755,76 @@ export class SafientCore { createdBy: this.connection.idx?.id, claimStatus: ClaimStages.ACTIVE, disputeId: disputeId, - timeStamp: timeStamp + timeStamp: timeStamp, }); } - await this.database.save(safe, 'Safes'); + await this.database.save(safe, "Safes"); } const claimResponse: EventResponse = { - id: dispute.toString(), - recepient: { - name: creatorUser[0].name, - email: creatorUser[0].email, - phone: '' - } - } - return new SafientResponse({data: claimResponse}); - }else{ - throw new SafientResponse({error: Errors.WalletBalance}) + id: dispute.toString(), + recepient: { + name: creatorUser[0].name, + email: creatorUser[0].email, + phone: "", + }, + }; + return new SafientResponse({ data: claimResponse }); + } else { + throw new SafientResponse({ error: Errors.WalletBalance }); } - } catch (err) { - throw new SafientResponse({error: Errors.ClaimNotCreated}) + throw new SafientResponse({ error: Errors.ClaimNotCreated }); } }; - - /** * This API is called by guardians when they have to recover the safe they are part of + * @ignore * @param safeId ID of the safe being recovered * @param did DID of the guardian * @returns True of False based on the recovery process */ - reconstructSafe = async (safeId: string, did: string): Promise> => { + reconstructSafe = async ( + safeId: string, + did: string + ): Promise> => { try { const safeData: SafientResponse = await this.getSafe(safeId); const safe = safeData.data!; const indexValue = safe.guardians.indexOf(did); let recoveryStatus: boolean = false; - // internal function - const res = await this.syncStage(safeId) + // internal function + const res = await this.syncStage(safeId); if (res.data === true && safe.stage === SafeStages.RECOVERING) { - const decShard: DecShard = await this.connection.idx?.ceramic.did?.decryptDagJWE( - safe.encSafeKeyShards[indexValue].data - ) as DecShard; + const decShard: DecShard = + (await this.connection.idx?.ceramic.did?.decryptDagJWE( + safe.encSafeKeyShards[indexValue].data + )) as DecShard; - await updateDecShard(did, safeId, decShard) - - const decShards: DecShard[] = await getDecShards(safe.guardians, safeId) + await updateDecShard(did, safeId, decShard); + + const decShards: DecShard[] = await getDecShards( + safe.guardians, + safeId + ); if (decShards.length >= 2) { safe.stage = SafeStages.RECOVERED; - safe.decSafeKeyShards = decShards - await deleteDecShard(safe.guardians, safeId) - + safe.decSafeKeyShards = decShards; + await deleteDecShard(safe.guardians, safeId); } else { safe.stage = SafeStages.RECOVERING; } recoveryStatus = true; - await this.database.save(safe, 'Safes'); + await this.database.save(safe, "Safes"); } else { recoveryStatus = false; } - return new SafientResponse({data: recoveryStatus}); + return new SafientResponse({ data: recoveryStatus }); } catch (err) { - throw new SafientResponse({error: Errors.GuardianRecoveryFailure}) + throw new SafientResponse({ error: Errors.GuardianRecoveryFailure }); } }; @@ -723,23 +833,23 @@ export class SafientCore { * @param safeId ID of the safe being recovered * @returns Decrypted Safe Data */ - recoverSafeByCreator = async (safeId: string): Promise> => { + recoverSafeByCreator = async ( + safeId: string + ): Promise> => { try { - let recoveredData: SafeRecovered = { - status: false, - data: null, - }; + const safeData: SafientResponse = await this.getSafe(safeId); const encSafeData = safeData.data!.encSafeData; - const data = await this.crypto.decryptSafeData(safeData.data!.encSafeKey, this.connection, encSafeData); + const data = await this.crypto.decryptSafeData( + safeData.data!.encSafeKey, + this.connection, + encSafeData + ); const reconstructedData = JSON.parse(data.toString()); - recoveredData = { - status: true, - data: reconstructedData, - }; - return new SafientResponse({data: reconstructedData}); + + return new SafientResponse({ data: reconstructedData.data }); } catch (err) { - throw new SafientResponse({error: Errors.CreatorRecoveryFailure}) + throw new SafientResponse({ error: Errors.CreatorRecoveryFailure }); } }; @@ -751,10 +861,14 @@ export class SafientCore { * @param safeStage The stage of the safe * @returns True or False based on update process */ - private updateStage = async (safeId: string, claimStage: number, safeStage: number): Promise> => { + private updateStage = async ( + safeId: string, + claimStage: number, + safeStage: number + ): Promise> => { try { const result: boolean = await updateStage(safeId, claimStage, safeStage); - return new SafientResponse({data: result}); + return new SafientResponse({ data: result }); } catch (err) { throw new Error(`Error while updating a stage ${err}`); } @@ -766,52 +880,78 @@ export class SafientCore { * @param did DID of the beneficiary * @returns Decrypted Safe Data */ - recoverSafeByBeneficiary = async (safeId: string, did: string): Promise => { + recoverSafeByBeneficiary = async ( + safeId: string, + did: string + ): Promise => { try { - let recoveredData: SafeRecovered = { - status: false, - data: null, - }; + let shards: Object[] = []; let reconstructedSafeData: any; let safeData: any; let result: any; + let beneficiaryEncKey: any; const safeResponse: SafientResponse = await this.getSafe(safeId); const safe = safeResponse.data!; - if (safe.stage === SafeStages.RECOVERED || safe.stage === SafeStages.CLAIMED) { - const decShards: DecShard[] = safe.decSafeKeyShards + if ( + safe.stage !== SafeStages.RECOVERED && + safe.stage !== SafeStages.CLAIMED && + safe.claimType !== null + ) { + + throw new SafientResponse({ error: Errors.StageNotUpdated }); + } + + if(safe.claimType !== null) { + const decShards: DecShard[] = safe.decSafeKeyShards; decShards.map((shard) => { shards.push(shard.share); }); reconstructedSafeData = await this.crypto.reconstructSafeData(shards); + beneficiaryEncKey = reconstructedSafeData.beneficiaryEncKey + + } + else { + + beneficiaryEncKey = safe.beneficiaryEncSafeKey; + } safeData = await this.crypto.decryptSafeData( - reconstructedSafeData.beneficiaryEncKey, + beneficiaryEncKey, this.connection, Buffer.from(safe.encSafeData) ); - if (safeData && safe.stage === SafeStages.RECOVERED) { - await this.updateStage(safeId, ClaimStages.PASSED, SafeStages.CLAIMED); + if (!safe.claimType) { result = JSON.parse(safeData.toString()); - return new SafientResponse({data: result.data}) - }else if(safeData && safe.stage === SafeStages.CLAIMED){ + return new SafientResponse({ data: result.data }); + } + else if (safeData && safe.stage === SafeStages.RECOVERED) { + await this.updateStage( + safeId, + ClaimStages.PASSED, + SafeStages.CLAIMED + ); result = JSON.parse(safeData.toString()); - return new SafientResponse({data: result.data}) - } - else { - throw new SafientResponse({error: Errors.BeneficiaryRecoveryFailure}) + return new SafientResponse({ data: result.data }); + } else if (safeData && safe.stage === SafeStages.CLAIMED) { + result = JSON.parse(safeData.toString()); + return new SafientResponse({ data: result.data }); + } else { + throw new SafientResponse({ + error: Errors.BeneficiaryRecoveryFailure, + }); } - }else { - throw new SafientResponse({error: Errors.StageNotUpdated}) - } + } catch (err) { - if(err instanceof SafientResponse){ - if(err.error?.code === Errors.StageNotUpdated.code){ - throw new SafientResponse({error: Errors.StageNotUpdated}) - }else{ - throw new SafientResponse({error: Errors.BeneficiaryRecoveryFailure}) + if (err instanceof SafientResponse) { + if (err.error?.code === Errors.StageNotUpdated.code) { + throw new SafientResponse({ error: Errors.StageNotUpdated }); + } else { + throw new SafientResponse({ + error: Errors.BeneficiaryRecoveryFailure, + }); } } } @@ -827,7 +967,7 @@ export class SafientCore { const data = await this.contract.getSafeBySafeId(safeId); return data; } catch (err) { - throw new SafientResponse({error: Errors.OnChainSafeNotFound}) + throw new SafientResponse({ error: Errors.OnChainSafeNotFound }); } }; @@ -841,7 +981,7 @@ export class SafientCore { const data = await this.contract.getClaimByClaimId(claimId); return data; } catch (err) { - throw new SafientResponse({error: Errors.OnChainSafeNotFound}) + throw new SafientResponse({ error: Errors.OnChainSafeNotFound }); } }; @@ -856,7 +996,7 @@ export class SafientCore { const claimStage = await this.contract.getClaimStatus(safeId, claimId); return claimStage; } catch (err) { - throw new SafientResponse({error: Errors.OnChainClaimStatus}) + throw new SafientResponse({ error: Errors.OnChainClaimStatus }); } }; @@ -885,15 +1025,18 @@ export class SafientCore { safe.stage = SafeStages.RECOVERING; safe.claims[claimIndex].claimStatus = ClaimStages.PASSED; } - if (claimStage === ClaimStages.FAILED || claimStage === ClaimStages.REJECTED) { + if ( + claimStage === ClaimStages.FAILED || + claimStage === ClaimStages.REJECTED + ) { safe.stage = SafeStages.ACTIVE; safe.claims[claimIndex].claimStatus = claimStage; } - await this.database.save(safe, 'Safes'); - return new SafientResponse({data: true}); + await this.database.save(safe, "Safes"); + return new SafientResponse({ data: true }); } catch (err) { - throw new SafientResponse({error: Errors.SyncStageFailure}) + throw new SafientResponse({ error: Errors.SyncStageFailure }); } }; @@ -903,12 +1046,18 @@ export class SafientCore { * Use at your loss * If you reading this code and come across this, be warned not to use this at all * */ - giveRuling = async (disputeId: number, ruling: number): Promise> => { + giveRuling = async ( + disputeId: number, + ruling: number + ): Promise> => { try { - const result: boolean = await this.arbitrator.giveRulingCall(disputeId, ruling); - return new SafientResponse({data: result}); + const result: boolean = await this.arbitrator.giveRulingCall( + disputeId, + ruling + ); + return new SafientResponse({ data: result }); } catch (err) { - throw new SafientResponse({error: Errors.RulingFailure}) + throw new SafientResponse({ error: Errors.RulingFailure }); } }; @@ -917,7 +1066,9 @@ export class SafientCore { * @param safeId ID of the safe * @returns Transaction details of the signal */ - createSignal = async (safeId: string): Promise> => { + createSignal = async ( + safeId: string + ): Promise> => { try { const tx: TransactionResponse = await this.contract.sendSignal(safeId); const txReceipt: TransactionReceipt = await tx.wait(); @@ -925,39 +1076,43 @@ export class SafientCore { await this.updateStage(safeId, ClaimStages.ACTIVE, SafeStages.ACTIVE); } - return new SafientResponse({data: txReceipt}); + return new SafientResponse({ data: txReceipt }); } catch (err) { - throw new SafientResponse({error: Errors.SignalCreateFailure}) + throw new SafientResponse({ error: Errors.SignalCreateFailure }); } }; /** * This API is used by guardians to claim the incentivisation + * @ignore * @param safeId ID of the safe * @returns True or false based on the incentivisation process */ - incentiviseGuardians = async (safeId: string): Promise> => { + incentiviseGuardians = async ( + safeId: string + ): Promise> => { try { let shards: any = []; let guardianArray: any = []; let guardianSecret: string[] = []; - let txResponse: TransactionResponse - let txReceipt: TransactionReceipt | undefined + let txResponse: TransactionResponse; + let txReceipt: TransactionReceipt | undefined; const safeData: SafientResponse = await this.getSafe(safeId); const safe = safeData.data!; if (!safe.proofSubmission && safe.decSafeKeyShards.length >= 2) { - const decShards: DecShard[] = safe.decSafeKeyShards + const decShards: DecShard[] = safe.decSafeKeyShards; decShards.map((shard) => { - shards.push(shard.share); - guardianSecret.push(shard.secret); + shards.push(shard.share); + guardianSecret.push(shard.secret); }); if (shards.length !== 0) { - const reconstructedData: Share = await this.crypto.reconstructSafeData([ - Buffer.from(shards[0]), - Buffer.from(shards[1]), - ]); + const reconstructedData: Share = + await this.crypto.reconstructSafeData([ + Buffer.from(shards[0]), + Buffer.from(shards[1]), + ]); const message = reconstructedData.message; message.data.guardians.map((guardian: any) => { const guardianTuple = [guardian.secret, guardian.address]; @@ -973,52 +1128,56 @@ export class SafientCore { ); txReceipt = await txResponse.wait(); } - if(txReceipt?.status){ - safe.proofSubmission = true - await this.database.save(safe, "Safes") - return new SafientResponse({data: true}); - }else{ - throw new SafientResponse({error: Errors.IncentivizationFailure}) + if (txReceipt?.status) { + safe.proofSubmission = true; + await this.database.save(safe, "Safes"); + return new SafientResponse({ data: true }); + } else { + throw new SafientResponse({ error: Errors.IncentivizationFailure }); } - }else{ - throw new SafientResponse({error: Errors.IncentivizationComplete}) + } else { + throw new SafientResponse({ error: Errors.IncentivizationComplete }); } } catch (err) { - if(err instanceof SafientResponse){ - if(err.error?.code === Errors.IncentivizationComplete.code){ - throw new SafientResponse({error: Errors.IncentivizationComplete}) + if (err instanceof SafientResponse) { + if (err.error?.code === Errors.IncentivizationComplete.code) { + throw new SafientResponse({ error: Errors.IncentivizationComplete }); } } - throw new SafientResponse({error: Errors.IncentivizationFailure}) + throw new SafientResponse({ error: Errors.IncentivizationFailure }); } }; - /** * This function returns the total guardian reward balance of a guardian * @param address The address of the guardian * @returns The total guardian reward balance in ETH */ - getRewardBalance = async (address: string): Promise> => { + getRewardBalance = async ( + address: string + ): Promise> => { try { const result: Number = await this.contract.getGuardianRewards(address); - return new SafientResponse({data: result}); + return new SafientResponse({ data: result }); } catch (e) { - throw new SafientResponse({error: Errors.RewardsAccessFailure}) + throw new SafientResponse({ error: Errors.RewardsAccessFailure }); } }; /** + * @ignore * This function allows the guardians to claim their rewards * @param funds Total funds need to be claimed in ETH * @returns A transaction response */ claimRewards = async (funds: number): Promise => { try { - const result: TransactionResponse = await this.contract.claimRewards(funds); + const result: TransactionResponse = await this.contract.claimRewards( + funds + ); return result; } catch (e) { - throw new SafientResponse({error: Errors.RewardsClaimFailure}) + throw new SafientResponse({ error: Errors.RewardsClaimFailure }); } }; @@ -1028,12 +1187,18 @@ export class SafientCore { * @param dDay The timestamp in unix epoch milliseconds after which the beneficiary can directly claim the safe * @returns A transaction response */ - updateDDay = async (safeId: string, dDay: number): Promise => { + updateDDay = async ( + safeId: string, + dDay: number + ): Promise => { try { - const result: TransactionResponse = await this.contract.updateDDay(safeId, dDay); + const result: TransactionResponse = await this.contract.updateDDay( + safeId, + dDay + ); return result; } catch (e) { - throw new SafientResponse({error: Errors.DDayUpdateFailure}) + throw new SafientResponse({ error: Errors.DDayUpdateFailure }); } }; } diff --git a/src/crypto/lib/crypto.ts b/src/crypto/lib/crypto.ts index 42585d8..fa3c72d 100644 --- a/src/crypto/lib/crypto.ts +++ b/src/crypto/lib/crypto.ts @@ -1,4 +1,4 @@ -import { Connection, SafeEncrypted, GuardianSecrets, RecoveryMessage, Shard, Share, User, SafeStore } from "../../lib/types" +import { Connection, SafeEncrypted, GuardianSecrets, RecoveryMessage, Shard, Share, User, SafeStore, DecShard } from "../../lib/types" import {_decryptData, _encryptData, _generateCipherKey, _shamirCombine, _shamirSplit} from "../utils/encryption" import {randomBytes, JWE, utils} from "../utils/helpers" @@ -20,16 +20,18 @@ export class Crypto { */ encryptSafeData = async ( safeData: SafeStore, - beneficiaryDid: string, creatorDid: any, creator: Connection, guardians: string [], signature: string, recoveryMessage: string, - secrets: string [] + secrets: string [], + beneficiaryDid?: string ): Promise => { let shardData: Shard[] = []; + let decSardData: DecShard[] = []; + let beneficiaryEncKey: JWE | null = null; try{ @@ -46,8 +48,9 @@ export class Crypto { //Encrypt AES for creator const creatorEncKey: JWE = await creator.idx?.ceramic.did?.createDagJWE(aesKey, [creatorDid])!; + if (beneficiaryDid) { //Encrypt AES for beneficiary - const beneficiaryEncKey: JWE = await creator.idx?.ceramic.did?.createDagJWE(aesKey, [beneficiaryDid])!; + beneficiaryEncKey = await creator.idx?.ceramic.did?.createDagJWE(aesKey, [beneficiaryDid])!; const ShareData: Share = { beneficiaryEncKey : beneficiaryEncKey, @@ -64,6 +67,10 @@ export class Crypto { secret: secrets[shardIndex] }, [guardians[shardIndex]]), }) + decSardData.push({ + share: shards[shardIndex], + secret: secrets[shardIndex]}) + } } let result: SafeEncrypted = { @@ -71,6 +78,7 @@ export class Crypto { beneficiaryEncKey: beneficiaryEncKey, encryptedData: encryptedData, shardData: shardData, + decSardData: decSardData, } return result; diff --git a/src/index.ts b/src/index.ts index 59dcbc5..9e8ed88 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ export * from './SafientCore'; export * as Types from "./lib/types"; export * as Enums from "./lib/enums" -export * as Errors from "./lib/errors" +export * from "./lib/errors" diff --git a/src/lib/errors.ts b/src/lib/errors.ts index f343fc3..87b60a8 100644 --- a/src/lib/errors.ts +++ b/src/lib/errors.ts @@ -1,16 +1,21 @@ export const Errors = { UserNotFound : { - code: 10, + code: 100, message: "User not found" }, + UserAlreadyExists: { - code: 11, + code: 101, message: "User already exists" }, GuardianNotFound: { - code: 12, + code: 102, message: "Guardian not Found" }, + BeneficiaryNotFound : { + code: 103, + message: "User not found" + }, SafeNotCreated: { code: 201, message: "Safe not created" @@ -29,11 +34,11 @@ export const Errors = { }, CreatorRecoveryFailure: { code: 205, - message: "Guardian Recovery failed" + message: "Creator Recovery failed" }, BeneficiaryRecoveryFailure: { code: 206, - message: "Guardian Recovery failed" + message: "Beneficiary Recovery failed" }, StageNotUpdated: { code: 207, @@ -49,7 +54,7 @@ export const Errors = { }, SyncStageFailure: { code: 211, - message: "Error while syyncing safes stages" + message: "Error while syncing safes stages" }, RulingFailure:{ code: 212, @@ -84,15 +89,15 @@ export const Errors = { message: "Incentivization already submitted." }, TransactionFailure: { - code: 31, + code: 301, message: "Transaction Failed" }, WalletBalance: { - code: 32, + code: 302, message: "Transaction cannot be created due to low Wallet Balance." }, CommonError: { - code: 2, + code: 1, message: "Something went wrong" } } \ No newline at end of file diff --git a/src/lib/types.ts b/src/lib/types.ts index 2090615..8b68fb2 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -17,38 +17,26 @@ export type Connection = { idx: IDX | null; }; -export type UserSchema = { - did: string; - email: string; - name: string; - safes: SafeMeta[]; - signUpMode: number; - userAddress: string; - guardian: boolean -}; - export interface User { _id: string; - _mod: number; did: string; - email: string; - name: string; + email?: string; + name?: string; safes: SafeMeta[]; - signUpMode: number; userAddress: string; guardian: boolean }; export type UserMeta = { - name: string; - email: string; + name?: string; + email?: string; did: string; }; export type SafeMeta = { - safeName: string + safeName?: string safeId: string; type: string; decShard: DecShard | null @@ -56,39 +44,20 @@ export type SafeMeta = { export interface Safe { _id: string; - safeName: string, - description: string, + safeName?: string, + description?: string, creator: string; guardians: string[]; - beneficiary: string; + beneficiary: string | null; encSafeKey: JWE; + beneficiaryEncSafeKey: JWE | null; encSafeData: Buffer; stage: number; encSafeKeyShards: Shard[]; decSafeKeyShards: DecShard[]; claims: Claim[]; onChain: boolean; - claimType: Types.ClaimType; - signalingPeriod: number, - dDay: number, - timeStamp: number, - proofSubmission: boolean, - cid: string -}; - -export type SafeCreation = { - safeName: string, - description: string, - creator: string | undefined; - guardians: string[]; - beneficiary: string | undefined; - encSafeKey: JWE; - encSafeData: Buffer; - stage: number; - encSafeKeyShards: Shard[]; - claims: Claim[]; - onChain: boolean; - claimType: Types.ClaimType; + claimType: Types.ClaimType | null; signalingPeriod: number, dDay: number, timeStamp: number, @@ -97,6 +66,7 @@ export type SafeCreation = { }; + export type Claim = { createdBy: string | undefined; claimStatus: number; @@ -136,9 +106,10 @@ export type Share = { export type SafeEncrypted = { creatorEncKey: JWE, - beneficiaryEncKey: JWE, + beneficiaryEncKey: JWE | null, encryptedData: Buffer, shardData: Shard[], + decSardData: DecShard[], } @@ -188,9 +159,9 @@ export type EventResponse = { } export type Recepient = { - name: string, - email: string, - phone: string, + name?: string, + email?: string, + phone?: string, } export type SecretSafe = { @@ -223,12 +194,12 @@ export type GenericError = { export type SafeLink = { creator: string; guardians: string[]; - beneficiary: string; + beneficiary: string | null; encSafeKey: JWE; encSafeData: Buffer; encSafeKeyShards: Shard[]; onChain: boolean; - claimType: Types.ClaimType; + claimType: Types.ClaimType | null; signalingPeriod: number, dDay: number, timeStamp: number diff --git a/src/logic/index.ts b/src/logic/index.ts index 415f982..97909a2 100644 --- a/src/logic/index.ts +++ b/src/logic/index.ts @@ -3,7 +3,7 @@ import {Database} from "../database" import {Storage} from "../storage/index" import {DatabaseType} from "../lib/enums" -import { Connection, Evidence, RegisterStatus, SafeCreation, Safe, User, UserMeta, UserResponse, UserSchema, Utils, SafeLink, DecShard } from "../lib/types"; +import { Connection, Evidence, RegisterStatus, Safe, User, UserMeta, UserResponse, Utils, SafeLink, DecShard } from "../lib/types"; var environment = require("browser-or-node"); @@ -34,11 +34,11 @@ export const init = (databaseType: DatabaseType, connectionObject: Connection): * @param email - Email of the user * @returns - The status of the user if he exists or not */ -export const checkUser = async(email: string): Promise =>{ +export const checkUser = async(did: string): Promise =>{ try{ let registerStatus: RegisterStatus - const result: User[] = await database.read('email', email, 'Users') + const result: User[] = await database.read('did', did, 'Users') if(result.length === 1){ registerStatus = { status: true, @@ -65,7 +65,7 @@ export const checkUser = async(email: string): Promise =>{ * @returns - Database ID of the created data */ -export const createUser = async(userData: UserSchema, did: string): Promise => { +export const createUser = async(userData: User, did: string): Promise => { try { @@ -74,7 +74,7 @@ export const createUser = async(userData: UserSchema, did: string): Promise => { + export const createSafe = async(safeData: Safe): Promise => { try{ const safe: string[] = await database.create(safeData, 'Safes') return safe diff --git a/src/storage/lib/storage.ts b/src/storage/lib/storage.ts index 6058e20..92fac40 100644 --- a/src/storage/lib/storage.ts +++ b/src/storage/lib/storage.ts @@ -18,6 +18,7 @@ export class Storage { return result; } }catch(err){ + console.log(err) throw new Error("Error while publishing data") } } @@ -40,7 +41,7 @@ export class Storage { return result; } }catch(err){ - throw new Error("Error while publishing data") + throw new Error("Error while getting data") } } } \ No newline at end of file diff --git a/src/storage/utils/ipfs.js b/src/storage/utils/ipfs.js index 89028c3..aac3a21 100644 --- a/src/storage/utils/ipfs.js +++ b/src/storage/utils/ipfs.js @@ -2,7 +2,7 @@ const fetch = require("node-fetch"); const encoder = new TextEncoder(); const {create} = require('ipfs-http-client') -const client = create(`https://ipfs.safient.io/api/v0`) +const client = create(`https://ipfs.kleros.io/api/v0`) export const ipfsPublish = async (fileName, data) => { const encodedData = encoder.encode(data) diff --git a/src/utils/networks.ts b/src/utils/networks.ts index b999b05..94092de 100644 --- a/src/utils/networks.ts +++ b/src/utils/networks.ts @@ -6,7 +6,7 @@ export const Networks = [ "safientMain": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", "arbitrator": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, - "threadId": [1,85,155,181,217,164,186,113,43,135,248,19,1,118,118,241,172,169,135,42,157,143,38,244,250,18,244,161,164,19,0,234,155,202], + "threadId": [1,85,93,22,208,61,246,45,179,96,14,195,135,106,9,37,164,181,23,163,70,154,18,218,58,111,39,47,12,232,152,221,8,141], "ceramic": { "CERAMIC_URL": "http://0.0.0.0:7007", "config": { @@ -31,7 +31,7 @@ export const Networks = [ "safientMain": "", "arbitrator": "" }, - "threadId": [1,85,224,59,133,212,56,89,195,42,112,158,252,143,96,35,63,28,175,36,55,183,38,29,131,0,183,156,60,25,19,79,123,50], + "threadId": [1,85,29,234,10,53,7,157,97,192,61,180,56,48,2,22,47,84,9,196,26,127,17,14,50,178,218,79,196,82,4,198,107,129], "ceramic": { "CERAMIC_URL": "https://ceramic.safient.io", "config": { @@ -56,7 +56,7 @@ export const Networks = [ "safientMain": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", "arbitrator": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, - "threadId": [1,85,80,127,181,68,182,72,102,205,134,52,114,140,252,60,202,121,104,1,254,161,68,70,206,54,41,135,185,183,109,155,83,210], + "threadId": [1,85,169,170,106,224,208,211,57,22,56,218,110,93,51,32,173,247,42,175,129,43,164,80,9,65,218,190,4,116,20,157,248,30], "ceramic": { "CERAMIC_URL": "http://0.0.0.0:7007", "config": { @@ -80,7 +80,7 @@ export const Networks = [ "safientMain": "0x8C2FA3dE952f5A1c463af0Fb42a9A812D3Ffe9e3", "arbitrator": "0x823E2b7623aD287819674548f43F8965F38B2626" }, - "threadId": [1,85,120,218,236,60,70,84,213,4,95,186,66,254,202,139,110,22,124,133,14,122,51,141,78,182,164,144,101,121,231,1,76,175], + "threadId": [1,85,9,109,19,103,1,168,185,231,88,22,247,217,104,122,75,238,32,212,163,63,22,250,183,121,17,21,244,123,136,157,194,213], "ceramic": { "CERAMIC_URL": "https://ceramic-clay.safient.io", "config": { diff --git a/test/scenario1.js b/test/scenario1.js index 4392c95..671cfdb 100644 --- a/test/scenario1.js +++ b/test/scenario1.js @@ -9,7 +9,8 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors } = require('../dist/index'); + describe('Scenario 1 - Creating safe offChain', async () => { let creator; @@ -22,7 +23,7 @@ describe('Scenario 1 - Creating safe offChain', async () => { let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner; let disputeId; let admin; - let creatorSc, beneficiarySc, guardianOneSc, guardianTwoSc, guardianThreeSc; + let safient; const apiKey = process.env.USER_API_KEY; const secret = process.env.USER_API_SECRET; @@ -45,139 +46,97 @@ describe('Scenario 1 - Creating safe offChain', async () => { guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); + + guardianOneAddress = await guardianOneSigner.getAddress(); + + safient = new SafientCore(Enums.NetworkType.localhost); }); + //Step 1: Register all users it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); + try{ - creator = await creatorSc.loginUser(); + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } } try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - expect(err.error.code).to.equal(11); + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); } - const loginUser = await creatorSc.getUser({ did: creator.data.did }); + const loginUser = await safient.getUser({ did: creator.data.did }); expect(loginUser.data.name).to.equal('Creator'); expect(loginUser.data.email).to.equal('creator@test.com'); }); it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); try{ - beneficiary = await beneficiarySc.loginUser(); + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); } } - - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); expect(loginUser.data.name).to.equal('beneficiary'); expect(loginUser.data.email).to.equal('beneficiary@test.com'); }); it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; try{ - guardianOne = await guardianOneSc.loginUser(); + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } } - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); expect(loginUser.data.name).to.equal('Guardian 1'); expect(loginUser.data.email).to.equal('guardianOne@test.com'); }); it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); try{ - guardianTwo = await guardianTwoSc.loginUser(); + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); } } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); expect(loginUser.data.name).to.equal('Guardian 2'); expect(loginUser.data.email).to.equal('guardianTwo@test.com'); }); it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); - const userAddress = await guardianThreeSigner.getAddress(); try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } + + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); + const loginUser = await safient.getUser({ did: guardianThree.data.did }); expect(loginUser.data.name).to.equal('Guardian 3'); expect(loginUser.data.email).to.equal('guardianThree@test.com'); }); @@ -195,19 +154,17 @@ describe('Scenario 1 - Creating safe offChain', async () => { const safeData = { data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "Off Chain", - "this safe creates offchain private key safe", - creator.data.did, + creator = await safient.loginUser(creatorSigner); + + const safeid = await safient.createSafe( safeData, - false, - ClaimType.ArbitrationBased, - 0, - 0, - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.ArbitrationBased}, + { name: "Off Chain", + description: "this safe creates offchain private key safe"} ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); @@ -216,14 +173,22 @@ describe('Scenario 1 - Creating safe offChain', async () => { const file = { name: 'signature.jpg', }; - const result = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + await safient.loginUser(beneficiarySigner); + const result = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text'}); disputeId = parseInt(result.data.id) expect(disputeId).to.be.a('number'); }); it('Should PASS the dispute', async () => { - const sc = new SafientCore(admin, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const result = await sc.giveRuling(disputeId, 1); //Passing a claim + + try { + await safient.loginUser(admin) + } + catch { + // Exception for admin user + + } + const result = await safient.giveRuling(disputeId, 1); //Passing a claim expect(result.data).to.equal(true); }); @@ -233,33 +198,45 @@ describe('Scenario 1 - Creating safe offChain', async () => { // }); it('Should initiate recovery by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Should initiate recovery by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); it('Should recover data for the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.privateKey).to.equal('0x81993E3b09f9ee1a5a8e5c59c9CF1411E5Bd28ea'); }); it('Should recover data for the creator', async () => { - const data = await creatorSc.recoverSafeByCreator(safeId); - expect(data.data.data.data.data.privateKey).to.equal('0x81993E3b09f9ee1a5a8e5c59c9CF1411E5Bd28ea'); + + await safient.loginUser(creatorSigner); + const data = await safient.recoverSafeByCreator(safeId); + expect(data.data.data.data.privateKey).to.equal('0x81993E3b09f9ee1a5a8e5c59c9CF1411E5Bd28ea'); }); it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianTwoSigner); + const result = await safient.incentiviseGuardians(safeId); expect(result.data).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); + + await safient.loginUser(guardianTwoSigner); + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); // const newBalance = await guardianOneSigner.getBalance(); // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); }); diff --git a/test/scenario2.js b/test/scenario2.js index 055b318..38f3c24 100644 --- a/test/scenario2.js +++ b/test/scenario2.js @@ -10,7 +10,7 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors} = require('../dist/index'); const { createFalse } = require('typescript'); describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () => { @@ -24,7 +24,7 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner; let disputeId; let admin; - let creatorSc, beneficiarySc, guardianOneSc, guardianTwoSc, guardianThreeSc; + let safient; const apiKey = process.env.USER_API_KEY; const secret = process.env.USER_API_SECRET; @@ -47,143 +47,100 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); - }); - //Step 1: Register all users - it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); - try{ - creator = await creatorSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - } - } - - try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } + guardianOneAddress = await guardianOneSigner.getAddress(); - const loginUser = await creatorSc.getUser({ did: creator.data.did }); - expect(loginUser.data.name).to.equal('Creator'); - expect(loginUser.data.email).to.equal('creator@test.com'); + safient = new SafientCore(Enums.NetworkType.localhost); }); - it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); - - try{ - beneficiary = await beneficiarySc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - - } +//Step 1: Register all users +it('Should register a Creator', async () => { + + try{ + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } + } + + try{ + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); + } + + const loginUser = await safient.getUser({ did: creator.data.did }); + expect(loginUser.data.name).to.equal('Creator'); + expect(loginUser.data.email).to.equal('creator@test.com'); +}); +it('Should register a beneficiary', async () => { - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } + try{ + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); + }catch(err){ + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); - expect(loginUser.data.name).to.equal('beneficiary'); - expect(loginUser.data.email).to.equal('beneficiary@test.com'); - }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); + expect(loginUser.data.name).to.equal('beneficiary'); + expect(loginUser.data.email).to.equal('beneficiary@test.com'); +}); - it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; - - try{ - guardianOne = await guardianOneSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - } - } +it('Should register a Guardian 1', async () => { - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + try{ + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 1'); - expect(loginUser.data.email).to.equal('guardianOne@test.com'); - }); - - it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 1'); + expect(loginUser.data.email).to.equal('guardianOne@test.com'); +}); - try{ - guardianTwo = await guardianTwoSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); +it('Should register a Guardian 2', async () => { - } - } + try{ + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 2'); - expect(loginUser.data.email).to.equal('guardianTwo@test.com'); - }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 2'); + expect(loginUser.data.email).to.equal('guardianTwo@test.com'); +}); - it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); +it('Should register a Guardian 3', async () => { + + try{ - const userAddress = await guardianThreeSigner.getAddress(); - try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } - } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); - expect(loginUser.data.name).to.equal('Guardian 3'); - expect(loginUser.data.email).to.equal('guardianThree@test.com'); - }); + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); + } + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + + } +} + + const loginUser = await safient.getUser({ did: guardianThree.data.did }); + expect(loginUser.data.name).to.equal('Guardian 3'); + expect(loginUser.data.email).to.equal('guardianThree@test.com'); +}); //should create a safe onChain and offChain it('Should create crypto safe with keystore as data onChain', async () => { @@ -199,19 +156,18 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "On Chain", - "This creates onChain keystore safe", - creator.data.did, + await safient.loginUser(creatorSigner); + + console.log(beneficiary) + const safeid = await safient.createSafe( safeData, - true, - ClaimType.ArbitrationBased, - 0, - 0, - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.ArbitrationBased}, + { name: "On Chain", + description: "This creates onChain keystore safe"} ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); @@ -220,7 +176,9 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text' }); disputeId = parseInt(res.data.id) expect(disputeId).to.be.a('number'); }); @@ -230,8 +188,10 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () const file = { name: 'signature.jpg', }; + + await safient.loginUser(beneficiarySigner); try{ - const res = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text') + const res = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text'} ) }catch(err){ expect(err.error.code).to.equal(203) } @@ -241,9 +201,15 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () }); it('Should FAIL the dispute on Claim 1', async () => { - const sc = new SafientCore(admin, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const result = await sc.giveRuling(disputeId, 2); //Passing a claim + try { + await safient.loginUser(admin) + } + catch { + // Exception for admin user + + } + const result = await safient.giveRuling(disputeId, 2); //Passing a claim expect(result.data).to.equal(true); }); @@ -252,41 +218,59 @@ describe('Scenario 2 - Creating safe onChain and Failing the dispute', async () const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text' }); disputeId = parseInt(res.data.id) expect(disputeId).to.be.a('number'); }); it('Should PASS the dispute on Claim 2', async () => { - const sc = new SafientCore(admin, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const result = await sc.giveRuling(disputeId, 1); //Passing a claim + try { + await safient.loginUser(admin) + } + catch { + // Exception for admin user + + } + const result = await safient.giveRuling(disputeId, 1); //Passing a claim expect(result.data).to.equal(true); }); it('Should initiate recovery by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Should initiate recovery by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); it('Should recover data for the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.keyStore).to.equal('key store'); }); it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianOneSigner); + const result = await safient.incentiviseGuardians(safeId); expect(result.data).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); + + await safient.loginUser(guardianOneSigner); + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); // const newBalance = await guardianOneSigner.getBalance(); // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); }); diff --git a/test/scenario3.js b/test/scenario3.js index ca655af..2cc2564 100644 --- a/test/scenario3.js +++ b/test/scenario3.js @@ -1,5 +1,4 @@ const { ThreadID } = require('@textile/hub'); -const { SafientClaims } = require('@safient/contracts'); const { utils } = require('ethers'); const { getThreadId } = require('../dist/utils/threadDb'); const fs = require('fs'); @@ -10,7 +9,7 @@ chai.use(require('chai-as-promised')); const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors } = require('../dist/index'); describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () => { let admin; @@ -23,10 +22,8 @@ describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () = let provider, chainId; let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner; let disputeId; - let creatorSc, beneficiarySc, guardianOneSc, guardianTwoSc, guardianThreeSc; + let safient; - const apiKey = process.env.USER_API_KEY; - const secret = process.env.USER_API_SECRET; const ClaimType = { SignalBased: 0, @@ -47,139 +44,98 @@ describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () = guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); + + guardianOneAddress = await guardianOneSigner.getAddress(); + + safient = new SafientCore(Enums.NetworkType.localhost); }); + + //Step 1: Register all users it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); + try{ - creator = await creatorSc.loginUser(); + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } } try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - expect(err.error.code).to.equal(11); + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); } - const loginUser = await creatorSc.getUser({ did: creator.data.did }); + const loginUser = await safient.getUser({ did: creator.data.did }); expect(loginUser.data.name).to.equal('Creator'); expect(loginUser.data.email).to.equal('creator@test.com'); }); it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); try{ - beneficiary = await beneficiarySc.loginUser(); + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); } } - - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); expect(loginUser.data.name).to.equal('beneficiary'); expect(loginUser.data.email).to.equal('beneficiary@test.com'); }); it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; try{ - guardianOne = await guardianOneSc.loginUser(); + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } } - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); expect(loginUser.data.name).to.equal('Guardian 1'); expect(loginUser.data.email).to.equal('guardianOne@test.com'); }); it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); try{ - guardianTwo = await guardianTwoSc.loginUser(); + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); } } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); expect(loginUser.data.name).to.equal('Guardian 2'); expect(loginUser.data.email).to.equal('guardianTwo@test.com'); }); it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); - const userAddress = await guardianThreeSigner.getAddress(); try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } + + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); + const loginUser = await safient.getUser({ did: guardianThree.data.did }); expect(loginUser.data.name).to.equal('Guardian 3'); expect(loginUser.data.email).to.equal('guardianThree@test.com'); }); @@ -198,19 +154,17 @@ describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () = data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "On chain safe", - "Software Wallet", - creator.data.did, + await safient.loginUser(creatorSigner); + + const safeid = await safient.createSafe( safeData, - true, - ClaimType.ArbitrationBased, - 0, - 0, - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.ArbitrationBased}, + { name: "On chain safe", + description: "Software Wallet"} ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); @@ -218,7 +172,8 @@ describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () = const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text' }); disputeId = parseInt(res.data.id) expect(disputeId).to.be.a('number'); }); @@ -227,40 +182,57 @@ describe('Scenario 3 - Creating safe onChain and Passed the dispute', async () = describe('Ruling...', async () => { it('Should PASS ruling on the dispute', async () => { - const sc = new SafientCore(admin, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret, null); - const result = await sc.giveRuling(disputeId, 1); //Passing a claim + try { + await safient.loginUser(admin) + } + catch { + // Exception for admin user + + } + + const result = await safient.giveRuling(disputeId, 1); //Passing a claim expect(result.data).to.equal(true); }); }); describe('Guardian recovery', async () => { it('Recovery done by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner) + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Recovery done by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner) + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); }); describe('Beneficiary data recovery', async () => { it('Data is recovered by the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner) + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.softwareWallet).to.equal('Instruction for software wallet'); }); }); describe('Guardian incentivisation', async () => { it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianOneSigner) + const result = await safient.incentiviseGuardians(safeId); expect(result.data).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); + + await safient.loginUser(guardianOneSigner) + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); // const newBalance = await guardianOneSigner.getBalance(); // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); }); diff --git a/test/scenario4.js b/test/scenario4.js index 6ff8f88..ce6be45 100644 --- a/test/scenario4.js +++ b/test/scenario4.js @@ -10,7 +10,7 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors } = require('../dist/index'); describe('Scenario 4 - Creating signal based Safe', async () => { let creator; @@ -46,144 +46,100 @@ describe('Scenario 4 - Creating signal based Safe', async () => { guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); - }); - //Step 1: Register all users - - it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); - try{ - creator = await creatorSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - } - } - - try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } + guardianOneAddress = await guardianOneSigner.getAddress(); - const loginUser = await creatorSc.getUser({ did: creator.data.did }); - expect(loginUser.data.name).to.equal('Creator'); - expect(loginUser.data.email).to.equal('creator@test.com'); + safient = new SafientCore(Enums.NetworkType.localhost); }); - it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); - - try{ - beneficiary = await beneficiarySc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - - } +//Step 1: Register all users +it('Should register a Creator', async () => { + + try{ + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } + } + + try{ + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); + } + + const loginUser = await safient.getUser({ did: creator.data.did }); + expect(loginUser.data.name).to.equal('Creator'); + expect(loginUser.data.email).to.equal('creator@test.com'); +}); +it('Should register a beneficiary', async () => { - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } + try{ + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); + }catch(err){ + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); - expect(loginUser.data.name).to.equal('beneficiary'); - expect(loginUser.data.email).to.equal('beneficiary@test.com'); - }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); + expect(loginUser.data.name).to.equal('beneficiary'); + expect(loginUser.data.email).to.equal('beneficiary@test.com'); +}); - it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; - - try{ - guardianOne = await guardianOneSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - } - } +it('Should register a Guardian 1', async () => { - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + try{ + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 1'); - expect(loginUser.data.email).to.equal('guardianOne@test.com'); - }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 1'); + expect(loginUser.data.email).to.equal('guardianOne@test.com'); +}); - it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); +it('Should register a Guardian 2', async () => { - try{ - guardianTwo = await guardianTwoSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + try{ + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); - } } + } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 2'); - expect(loginUser.data.email).to.equal('guardianTwo@test.com'); - }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 2'); + expect(loginUser.data.email).to.equal('guardianTwo@test.com'); +}); - it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); +it('Should register a Guardian 3', async () => { + + try{ - const userAddress = await guardianThreeSigner.getAddress(); - try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } - } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); - expect(loginUser.data.name).to.equal('Guardian 3'); - expect(loginUser.data.email).to.equal('guardianThree@test.com'); - }); + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); + } + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + + } +} + + const loginUser = await safient.getUser({ did: guardianThree.data.did }); + expect(loginUser.data.name).to.equal('Guardian 3'); + expect(loginUser.data.email).to.equal('guardianThree@test.com'); +}); //should create a safe onChain and offChain it('Should create crypto safe with hardware wallet with Signal Based Claim', async () => { @@ -198,19 +154,17 @@ describe('Scenario 4 - Creating signal based Safe', async () => { data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "On Chain Wallet - signal based", - "Hardware wallet instructions", - creator.data.did, + await safient.loginUser(creatorSigner); + + const safeid = await safient.createSafe( safeData, - true, - ClaimType.SignalBased, - 6, - 0, - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.SignalBased, period: 6}, + { name: "On Chain Wallet - signal based", + description: "Hardware wallet instructions"} ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); @@ -219,13 +173,17 @@ describe('Scenario 4 - Creating signal based Safe', async () => { const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, {}, '', ''); + + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); disputeId = parseInt(res.data.id) expect(disputeId).to.be.a('number'); }); it('Should send signal after claim', async () => { - const result = await creatorSc.createSignal(safeId); + + await safient.loginUser(creatorSigner); + const result = await safient.createSignal(safeId); expect(result.data.status).to.equal(1); }); @@ -233,7 +191,8 @@ describe('Scenario 4 - Creating signal based Safe', async () => { const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text' }); disputeId = parseInt(res.data.id) const mineNewBlock = new Promise((resolve, reject) => { setTimeout(() => { @@ -246,27 +205,37 @@ describe('Scenario 4 - Creating signal based Safe', async () => { it('Should initiate recovery by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Should initiate recovery by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); it('Should recover data for the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.hardwareWallet).to.equal('Instruction for hardware wallet'); }); it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianOneSigner); + const result = await safient.incentiviseGuardians(safeId); expect(result.data).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); + + await safient.loginUser(guardianOneSigner); + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); // const newBalance = await guardianOneSigner.getBalance(); // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); }); diff --git a/test/scenario5.js b/test/scenario5.js index 71e345e..484b441 100644 --- a/test/scenario5.js +++ b/test/scenario5.js @@ -10,7 +10,7 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors } = require('../dist/index'); describe('Scenario 5 - Creating signal based Safe', async () => { let creator; @@ -23,7 +23,7 @@ describe('Scenario 5 - Creating signal based Safe', async () => { let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner; let disputeId; let admin; - let creatorSc, beneficiarySc, guardianOneSc, guardianTwoSc, guardianThreeSc; + let safient; const apiKey = process.env.USER_API_KEY; const secret = process.env.USER_API_SECRET; @@ -46,141 +46,98 @@ describe('Scenario 5 - Creating signal based Safe', async () => { guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); + + guardianOneAddress = await guardianOneSigner.getAddress(); + + safient = new SafientCore(Enums.NetworkType.localhost); }); - //Step 1: Register all users + //Step 1: Register all users it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); + try{ - creator = await creatorSc.loginUser(); + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } } try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - expect(err.error.code).to.equal(11); + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); } - const loginUser = await creatorSc.getUser({ did: creator.data.did }); + const loginUser = await safient.getUser({ did: creator.data.did }); expect(loginUser.data.name).to.equal('Creator'); expect(loginUser.data.email).to.equal('creator@test.com'); }); it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); try{ - beneficiary = await beneficiarySc.loginUser(); + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); } } - - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); expect(loginUser.data.name).to.equal('beneficiary'); expect(loginUser.data.email).to.equal('beneficiary@test.com'); }); it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; try{ - guardianOne = await guardianOneSc.loginUser(); + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } } - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); expect(loginUser.data.name).to.equal('Guardian 1'); expect(loginUser.data.email).to.equal('guardianOne@test.com'); }); it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); try{ - guardianTwo = await guardianTwoSc.loginUser(); + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); } } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); expect(loginUser.data.name).to.equal('Guardian 2'); expect(loginUser.data.email).to.equal('guardianTwo@test.com'); }); it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); - const userAddress = await guardianThreeSigner.getAddress(); try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } + + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); + const loginUser = await safient.getUser({ did: guardianThree.data.did }); expect(loginUser.data.name).to.equal('Guardian 3'); expect(loginUser.data.email).to.equal('guardianThree@test.com'); }); @@ -193,19 +150,25 @@ describe('Scenario 5 - Creating signal based Safe', async () => { const safeData = { data: generic, }; - const safeid = await creatorSc.createSafe( - "Signal based", - "generic safe i.e Signal based", - creator.data.did, + + await safient.loginUser(creatorSigner); + + const safeid = await safient.createSafe( safeData, - true, - ClaimType.SignalBased, - 10, - 0, - {did: beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.SignalBased, period: 10}, + { name: "Signal based", + description: "generic safe i.e Signal based"} ); + + + safeData, + {did:beneficiary.data.did}, + {type: ClaimType.DDayBased, period: 0}, + { name: "DDay Safe", + description: "Hardware wallet safe"} safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); @@ -214,32 +177,40 @@ describe('Scenario 5 - Creating signal based Safe', async () => { const file = { name: 'signature.jpg', }; - const res = await beneficiarySc.createClaim(safeId, {}, '', ''); + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); disputeId = parseInt(res.data.id) expect(disputeId).to.be.a('number'); }); it('Should send signal after claim', async () => { - const result = await creatorSc.createSignal(safeId); + + await safient.loginUser(creatorSigner); + const result = await safient.createSignal(safeId); expect(result.data.status).to.equal(1); }); it('Should try recovery by guardian 1 and fail', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianThreeSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(false); }); it('Should try recovery by guardian 2 and fail', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(false); }); it('Should try recovering data for the beneficiary', async () => { try{ - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); - console.log(data) + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); }catch(err){ - expect(err.error.code).to.eql(207) + expect(err.error.code).to.eql(Errors.StageNotUpdated.code) } }); }); diff --git a/test/scenario6.js b/test/scenario6.js index a089749..349e670 100644 --- a/test/scenario6.js +++ b/test/scenario6.js @@ -10,7 +10,7 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { JsonRpcProvider } = require('@ethersproject/providers'); -const { Enums } = require('../dist/index'); +const { Enums, Errors } = require('../dist/index'); describe('Scenario 6 - Creating DDay based Safe', async () => { let creator; @@ -46,144 +46,100 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { guardianTwoSigner = await provider.getSigner(4); guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); - }); - //Step 1: Register all users - - it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); - try{ - creator = await creatorSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - } - } - - try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } + guardianOneAddress = await guardianOneSigner.getAddress(); - const loginUser = await creatorSc.getUser({ did: creator.data.did }); - expect(loginUser.data.name).to.equal('Creator'); - expect(loginUser.data.email).to.equal('creator@test.com'); + safient = new SafientCore(Enums.NetworkType.localhost); }); - it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); - - try{ - beneficiary = await beneficiarySc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - - } + //Step 1: Register all users + it('Should register a Creator', async () => { + + try{ + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } + } + + try{ + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); + } + + const loginUser = await safient.getUser({ did: creator.data.did }); + expect(loginUser.data.name).to.equal('Creator'); + expect(loginUser.data.email).to.equal('creator@test.com'); +}); +it('Should register a beneficiary', async () => { - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } - + try{ + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); + }catch(err){ + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); - expect(loginUser.data.name).to.equal('beneficiary'); - expect(loginUser.data.email).to.equal('beneficiary@test.com'); - }); + } + } - it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; + const loginUser = await safient.getUser({ did: beneficiary.data.did }); + expect(loginUser.data.name).to.equal('beneficiary'); + expect(loginUser.data.email).to.equal('beneficiary@test.com'); +}); - try{ - guardianOne = await guardianOneSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - } - } +it('Should register a Guardian 1', async () => { - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + try{ + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 1'); - expect(loginUser.data.email).to.equal('guardianOne@test.com'); - }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 1'); + expect(loginUser.data.email).to.equal('guardianOne@test.com'); +}); - it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); +it('Should register a Guardian 2', async () => { - try{ - guardianTwo = await guardianTwoSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + try{ + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); - } } + } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); - expect(loginUser.data.name).to.equal('Guardian 2'); - expect(loginUser.data.email).to.equal('guardianTwo@test.com'); - }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 2'); + expect(loginUser.data.email).to.equal('guardianTwo@test.com'); +}); - it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); +it('Should register a Guardian 3', async () => { + + try{ - const userAddress = await guardianThreeSigner.getAddress(); - try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } - } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); - expect(loginUser.data.name).to.equal('Guardian 3'); - expect(loginUser.data.email).to.equal('guardianThree@test.com'); - }); + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); + } + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + + } +} + + const loginUser = await safient.getUser({ did: guardianThree.data.did }); + expect(loginUser.data.name).to.equal('Guardian 3'); + expect(loginUser.data.email).to.equal('guardianThree@test.com'); +}); //should create a safe onChain and offChain it('Should create crypto safe with hardware wallet with DDay Based Claim', async () => { @@ -199,31 +155,29 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { }; - const safeid = await creatorSc.createSafe( - "DDay Safe", - "Hardware wallet safe", - creator.data.did, + await safient.loginUser(creatorSigner); + + const safeid = await safient.createSafe( safeData, - true, - ClaimType.DDayBased, - 0, - 120, // 2 mins after the safe creation - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.DDayBased, period: 0}, + { name: "DDay Safe", + description: "Hardware wallet safe"} ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); }); it('Should create a claim - Before D-Day (claim should FAIL)', async () => { try{ - const res = await beneficiarySc.createClaim(safeId, {}, '', ''); + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); disputeId = parseInt(res.data.id) }catch(err){ - expect(err.error.code).to.eql(209) + expect(err.error.code).to.eql(Errors.ClaimNotCreated.code) } - // check claim status }); it('Should create a claim - After D-Day (claim should PASS)', async () => { @@ -235,11 +189,12 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { }); const result = await mineNewBlock; - const res = await beneficiarySc.createClaim(safeId, {}, '', ''); + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); disputeId = parseInt(res.data.id) // check claim status - const claimResult = await beneficiarySc.getClaimStatus(safeId, disputeId); + const claimResult = await safient.getClaimStatus(safeId, disputeId); expect(claimResult).to.equal(1); // claim got Passed (after D-Day) }); @@ -258,33 +213,34 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "DDay Safe", - "Hardware wallet safe", - creator.data.did, + await safient.loginUser(creatorSigner); + const safeid = await safient.createSafe( safeData, - true, - ClaimType.DDayBased, - 0, - 120, // 2 mins after the safe creation - {did:beneficiary.data.did} + {did:beneficiary.data.did}, + {type: ClaimType.DDayBased, period: 60}, + { name: "DDay Safe", + description: "Hardware wallet safe"}, + true ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); - // create a claim - before D-Day (2 mins) (claim should fail) - const res = await beneficiarySc.createClaim(safeId, {}, '', ''); - disputeId = parseInt(res.data.id) - // check claim status - claimResult = await beneficiarySc.getClaimStatus(safeId, disputeId); - expect(claimResult).to.equal(2); // claim got Failed (before D-Day) + // create a claim - before D-Day (1 min) (claim should fail) + try{ + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); + disputeId = parseInt(res.data.id) + }catch(err){ + expect(err.error.code).to.eql(Errors.ClaimNotCreated.code) + } // update the D-Day to 60 secs from the time of updating latestBlockNumber = await provider.getBlockNumber(); latestBlock = await provider.getBlock(latestBlockNumber); now = latestBlock.timestamp; - await creatorSc.updateDDay(safeId, now + 60); + await safient.loginUser(creatorSigner); + await safient.updateDDay(safeId, now + 60); // mine a new block after 10 seconds mineNewBlock = new Promise((resolve, reject) => { @@ -295,12 +251,13 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { const result1 = await mineNewBlock; // create a claim - before D-Day (after 10 secs but before 60 secs) (claim should fail) - const newRes = await beneficiarySc.createClaim(safeId, {}, '', ''); - disputeId = parseInt(newRes.data.id); - // check claim status - claimResult = await beneficiarySc.getClaimStatus(safeId, disputeId); - - expect(claimResult).to.equal(2); // claim got Failed (before D-Day) + try{ + await safient.loginUser(beneficiarySigner); + const res = await safient.createClaim(safeId); + disputeId = parseInt(res.data.id) + }catch(err){ + expect(err.error.code).to.eql(Errors.ClaimNotCreated.code) + } // mine a new block after 50 seconds mineNewBlock = new Promise((resolve, reject) => { @@ -311,10 +268,10 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { const result2 = await mineNewBlock; // create a claim - after D-Day (after 60 secs) (claim should pass) - const result = await beneficiarySc.createClaim(safeId, {}, '', ''); + const result = await safient.createClaim(safeId); disputeId = parseInt(result.data.id); // check claim status - claimResult = await beneficiarySc.getClaimStatus(safeId, disputeId); + claimResult = await safient.getClaimStatus(safeId, disputeId); expect(claimResult).to.equal(1); // claim got Passed (after D-Day) }); @@ -324,27 +281,37 @@ describe('Scenario 6 - Creating DDay based Safe', async () => { // }); it('Should initiate recovery by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Should initiate recovery by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); it('Should recover data for the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.hardwareWallet).to.equal('Instruction for hardware wallet'); }); it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianOneSigner); + const result = await safient.incentiviseGuardians(safeId); expect(result).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); + + await safient.loginUser(guardianOneSigner); + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); // const newBalance = await guardianOneSigner.getBalance(); // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); }); diff --git a/test/scenario7.js b/test/scenario7.js new file mode 100644 index 0000000..0ebe2d2 --- /dev/null +++ b/test/scenario7.js @@ -0,0 +1,185 @@ +const { Client, PrivateKey, ThreadID, Where } = require('@textile/hub'); +const { randomBytes } = require('crypto'); +const { getThreadId } = require('../dist/utils/threadDb'); +const chai = require('chai'); +const { writeFile } = require('fs').promises; + +const expect = chai.expect; +chai.use(require('chai-as-promised')); + +// Import package +const { SafientCore } = require('../dist/index'); +const { Enums } = require('../dist/index'); +const { Errors } = require('../dist/index') +const { JsonRpcProvider } = require('@ethersproject/providers'); +const { SignatureKind } = require('typescript'); + +describe('No claim method', async () => { + let admin; + let creator; + let beneficiary; + let guardianOne; + let guardianTwo; + let guardianThree; + let safeId; + let provider, chainId; + let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner, randomUserSigner; + let disputeId; + let safient; + let guardianOneAddress; + let guardianOneRewardBalance; + + const ClaimType = { + SignalBased: 0, + ArbitrationBased: 1, + DDayBased: 2, + }; + + before(async () => { + provider = new JsonRpcProvider('http://localhost:8545'); + const network = await provider.getNetwork(); + chainId = network.chainId; + + admin = await provider.getSigner(0); + creatorSigner = await provider.getSigner(1); + + beneficiarySigner = await provider.getSigner(2); + guardianOneSigner = await provider.getSigner(3); + guardianTwoSigner = await provider.getSigner(4); + guardianThreeSigner = await provider.getSigner(5); + pseudoAccount = await provider.getSigner(6); + randomUserSigner = await provider.getSigner(7) + + guardianOneAddress = await guardianOneSigner.getAddress(); + + safient = new SafientCore(Enums.NetworkType.localhost); + }); + + //Step 1: Register all users + it('Should register a Creator', async () => { + + try{ + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); + } + } + + try{ + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); + }catch(err){ + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); + } + + const loginUser = await safient.getUser({ did: creator.data.did }); + expect(loginUser.data.name).to.equal('Creator'); + expect(loginUser.data.email).to.equal('creator@test.com'); + }); + + it('Should register a beneficiary', async () => { + + try{ + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); + }catch(err){ + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); + + } + } + + const loginUser = await safient.getUser({ did: beneficiary.data.did }); + expect(loginUser.data.name).to.equal('beneficiary'); + expect(loginUser.data.email).to.equal('beneficiary@test.com'); + }); + + it('Should register a Guardian 1', async () => { + + try{ + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); + } + } + + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 1'); + expect(loginUser.data.email).to.equal('guardianOne@test.com'); + }); + + it('Should register a Guardian 2', async () => { + + try{ + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); + }catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); + + } + } + + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); + expect(loginUser.data.name).to.equal('Guardian 2'); + expect(loginUser.data.email).to.equal('guardianTwo@test.com'); + }); + + it('Should register a Guardian 3', async () => { + + try{ + + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); + } + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + + } + } + + const loginUser = await safient.getUser({ did: guardianThree.data.did }); + expect(loginUser.data.name).to.equal('Guardian 3'); + expect(loginUser.data.email).to.equal('guardianThree@test.com'); + }); + + it('Should create a new Crypto Safe with Seed phrase', async () => { + + creator = await safient.loginUser(creatorSigner); + const secretSafe = { + seedPhrase: 'index negative film salon crumble wish rebuild seed betray meadow next ability', + privateKey: null, + keyStore: null, + }; + const cryptoSafe = { + data: secretSafe, + }; + const safeData = { + data: cryptoSafe, + }; + const safeid = await safient.createSafe( + safeData, + {email: 'beneficiary@test.com'}, + null, + { name: "On Chain Unit test", + description: "Crytpo safe with seed phrase"}, + ); + safeId = safeid.data.id; + const safe = await safient.getSafe(safeId); + expect(safe.data.creator).to.equal(creator.data.did); + expect(safe.data.safeName).to.equal("On Chain Unit test") + }); + + + it('Should recover data for the beneficiary', async () => { + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + expect(data.data.data.data.seedPhrase).to.equal( + 'index negative film salon crumble wish rebuild seed betray meadow next ability' + ); + }); + + +}); diff --git a/test/unitTest.js b/test/unitTest.js index 16d1a1c..c8b15fd 100644 --- a/test/unitTest.js +++ b/test/unitTest.js @@ -10,7 +10,7 @@ chai.use(require('chai-as-promised')); // Import package const { SafientCore } = require('../dist/index'); const { Enums } = require('../dist/index'); -const {Errors} = require('../dist/index') +const { Errors } = require('../dist/index') const { JsonRpcProvider } = require('@ethersproject/providers'); const { SignatureKind } = require('typescript'); @@ -25,11 +25,9 @@ describe('Unit test', async () => { let provider, chainId; let creatorSigner, beneficiarySigner, guardianOneSigner, guardianTwoSigner, guardianThreeSigner, randomUserSigner; let disputeId; - let creatorSc, beneficiarySc, guardianOneSc, guardianTwoSc, guardianThreeSc; + let safient; let guardianOneAddress; let guardianOneRewardBalance; - const apiKey = process.env.USER_API_KEY; - const secret = process.env.USER_API_SECRET; const ClaimType = { SignalBased: 0, @@ -51,145 +49,104 @@ describe('Unit test', async () => { guardianThreeSigner = await provider.getSigner(5); pseudoAccount = await provider.getSigner(6); randomUserSigner = await provider.getSigner(7) + + guardianOneAddress = await guardianOneSigner.getAddress(); + + safient = new SafientCore(Enums.NetworkType.localhost); }); //Step 1: Register all users it('Should register a Creator', async () => { - creatorSc = new SafientCore(creatorSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const userAddress = await creatorSigner.getAddress(); + try{ - creator = await creatorSc.loginUser(); + creator = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - creator = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + if(err.error.code === Errors.UserAlreadyExists.code){ + creator = await safient.loginUser(creatorSigner); } } try{ - const result = await creatorSc.createUser('Creator', 'creator@test.com', 0, userAddress, false); + const result = await safient.createUser(creatorSigner, {name: 'Creator', email: 'creator@test.com'}); }catch(err){ - expect(err.error.code).to.equal(11); + expect(err.error.code).to.equal(Errors.UserAlreadyExists.code); } - const loginUser = await creatorSc.getUser({ did: creator.data.did }); + const loginUser = await safient.getUser({ did: creator.data.did }); expect(loginUser.data.name).to.equal('Creator'); expect(loginUser.data.email).to.equal('creator@test.com'); }); it('Should register a beneficiary', async () => { - beneficiarySc = new SafientCore(beneficiarySigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - - // SUCCESS : create user A - - const userAddress = await beneficiarySigner.getAddress(); try{ - beneficiary = await beneficiarySc.loginUser(); + beneficiary = await safient.createUser(beneficiarySigner, { name: 'beneficiary', email: 'beneficiary@test.com'}); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - beneficiary = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); + + if(err.error.code === Errors.UserAlreadyExists.code){ + beneficiary = await safient.loginUser(beneficiarySigner); } } - - try{ - const result = await beneficiarySc.createUser('beneficiary', 'beneficiary@test.com', 0, userAddress, false); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await beneficiarySc.getUser({ did: beneficiary.data.did }); + const loginUser = await safient.getUser({ did: beneficiary.data.did }); expect(loginUser.data.name).to.equal('beneficiary'); expect(loginUser.data.email).to.equal('beneficiary@test.com'); }); it('Should register a Guardian 1', async () => { - guardianOneSc = new SafientCore(guardianOneSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianOneSigner.getAddress(); - guardianOneAddress = userAddress; try{ - guardianOne = await guardianOneSc.loginUser(); + guardianOne = await safient.createUser(guardianOneSigner, {name: 'Guardian 1', email: 'guardianOne@test.com'}, true); + }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianOne = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianOne = await safient.loginUser(guardianOneSigner); } } - try{ - const result = await guardianOneSc.createUser('Guardian 1', 'guardianOne@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianOneSc.getUser({ email: `guardianOne@test.com` }); + const loginUser = await safient.getUser({ email: `guardianOne@test.com` }); expect(loginUser.data.name).to.equal('Guardian 1'); expect(loginUser.data.email).to.equal('guardianOne@test.com'); }); it('Should register a Guardian 2', async () => { - guardianTwoSc = new SafientCore(guardianTwoSigner, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - // SUCCESS : create user A - const userAddress = await guardianTwoSigner.getAddress(); try{ - guardianTwo = await guardianTwoSc.loginUser(); + guardianTwo = await safient.createUser(guardianTwoSigner, {name: 'Guardian 2', email: 'guardianTwo@test.com'}, true); }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianTwo = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianTwo = await safient.loginUser(guardianTwoSigner); } } - try{ - const result = await guardianTwoSc.createUser('Guardian 2', 'guardianTwo@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); - } - - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianTwoSc.getUser({ email: `guardianTwo@test.com` }); + const loginUser = await safient.getUser({ email: `guardianTwo@test.com` }); expect(loginUser.data.name).to.equal('Guardian 2'); expect(loginUser.data.email).to.equal('guardianTwo@test.com'); }); it('Should register a Guardian 3', async () => { - guardianThreeSc = new SafientCore( - guardianThreeSigner, - Enums.NetworkType.localhost, - Enums.DatabaseType.threadDB, - apiKey, - secret - ); - const userAddress = await guardianThreeSigner.getAddress(); try{ - guardianThree = await guardianThreeSc.loginUser(); - }catch(err){ - if(err.error.code === Errors.Errors.UserNotFound.code){ - guardianThree = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - } + + guardianThree = await safient.createUser(guardianThreeSigner, {name: 'Guardian 3', email: 'guardianThree@test.com'}, true); } - - - try{ - const result = await guardianThreeSc.createUser('Guardian 3', 'guardianThree@test.com', 0, userAddress, true); - }catch(err){ - expect(err.error.code).to.equal(11); + catch(err){ + if(err.error.code === Errors.UserAlreadyExists.code){ + guardianThree = await safient.loginUser(guardianThreeSigner); + } + } - // SUCCESS : get all users (check if the user A was created) - const loginUser = await guardianThreeSc.getUser({ did: guardianThree.data.did }); + const loginUser = await safient.getUser({ did: guardianThree.data.did }); expect(loginUser.data.name).to.equal('Guardian 3'); expect(loginUser.data.email).to.equal('guardianThree@test.com'); }); it('Should create a new Crypto Safe with Seed phrase', async () => { + + creator = await safient.loginUser(creatorSigner); const secretSafe = { seedPhrase: 'index negative film salon crumble wish rebuild seed betray meadow next ability', privateKey: null, @@ -201,78 +158,94 @@ describe('Unit test', async () => { const safeData = { data: cryptoSafe, }; - const safeid = await creatorSc.createSafe( - "On Chain Unit test", - "Crytpo safe with seed phrase", - creator.data.did, + const safeid = await safient.createSafe( safeData, - true, - ClaimType.ArbitrationBased, - 0, - 0, - {email: 'beneficiary@test.com'} + {email: 'beneficiary@test.com'}, + {type: ClaimType.ArbitrationBased, period: 0}, + { name: "On Chain Unit test", + description: "Crytpo safe with seed phrase"}, ); safeId = safeid.data.id; - const safe = await creatorSc.getSafe(safeId); + const safe = await safient.getSafe(safeId); expect(safe.data.creator).to.equal(creator.data.did); expect(safe.data.safeName).to.equal("On Chain Unit test") }); //Step 3: Create a claim it('Should create a claim', async () => { + + beneficiary = await safient.loginUser(beneficiarySigner); const file = { name: 'signature.jpg', }; - const result = await beneficiarySc.createClaim(safeId, file, 'Testing Evidence', 'Lorsem Text'); + const result = await safient.createClaim(safeId, { file: file, evidenceName: 'Testing Evidence', description: 'Lorsem Text' }); disputeId = result.data.id expect(disputeId).to.be.a('string'); }); it('Should give Ruling for the dispute', async () => { - const sc = new SafientCore(admin, Enums.NetworkType.localhost, Enums.DatabaseType.threadDB, apiKey, secret); - const result = await sc.giveRuling(parseInt(disputeId), 1); //Passing a claim + try { + await safient.loginUser(admin) + } + catch { + // Exception for admin user + + } + const result = await safient.giveRuling(parseInt(disputeId), 1); //Passing a claim expect(result.data).to.equal(true); }); // it('Should update the stage on threadDB', async () => { - // const result = await beneficiarySc.syncStage(safeId); + // const result = await safient.syncStage(safeId); // expect(result.data).to.equal(true); // }); // //Step 4: Recover Safes it('Should initiate recovery by guardian 1', async () => { - const data = await guardianOneSc.reconstructSafe(safeId, guardianOne.data.did); + + await safient.loginUser(guardianOneSigner); + const data = await safient.reconstructSafe(safeId, guardianOne.data.did); expect(data.data).to.equal(true); }); it('Should initiate recovery by guardian 2', async () => { - const data = await guardianTwoSc.reconstructSafe(safeId, guardianTwo.data.did); + + await safient.loginUser(guardianTwoSigner); + const data = await safient.reconstructSafe(safeId, guardianTwo.data.did); expect(data.data).to.equal(true); }); it('Should recover data for the beneficiary', async () => { - const data = await beneficiarySc.recoverSafeByBeneficiary(safeId, beneficiary.data.did); + + await safient.loginUser(beneficiarySigner); + const data = await safient.recoverSafeByBeneficiary(safeId, beneficiary.data.did); expect(data.data.data.data.seedPhrase).to.equal( 'index negative film salon crumble wish rebuild seed betray meadow next ability' ); }); it('Should submit proofs for the guardians', async () => { - const result = await guardianOneSc.incentiviseGuardians(safeId); + + await safient.loginUser(guardianOneSigner); + const result = await safient.incentiviseGuardians(safeId); expect(result.data).to.not.equal(false); }); it('Should get the guardians reward balance', async () => { - guardianOneRewardBalance = await guardianOneSc.getRewardBalance(guardianOneAddress); - // const newBalance = await guardianOneSigner.getBalance(); - // expect((parseInt(newBalance) > parseInt(prevBalance))).to.equal(true); + + await safient.loginUser(guardianOneSigner); + guardianOneRewardBalance = await safient.getRewardBalance(guardianOneAddress); + const newBalance = await guardianOneSigner.getBalance(); + expect(guardianOneRewardBalance) }); it('Should claim rewards for the guardian One', async () => { + + await safient.loginUser(guardianOneSigner); const prevBalance = await guardianOneSigner.getBalance(); - const result = await guardianOneSc.claimRewards(guardianOneRewardBalance.data); + const result = await safient.claimRewards(guardianOneRewardBalance.data); const newBalance = await guardianOneSigner.getBalance(); expect(parseInt(newBalance) > parseInt(prevBalance)).to.equal(true); });