From 1db8e4160b24a5d20ca7b12cc389e8b0033404a8 Mon Sep 17 00:00:00 2001 From: Ng Zhao Loong Date: Tue, 12 Sep 2023 09:45:47 +0800 Subject: [PATCH] Feat/tpac (#821) * feat: bump packages to alpha * chore: v4 compatibility --- package-lock.json | 1069 ++++++++++++----- package.json | 6 +- .../DocumentStatus/DocumentStatus.tsx | 17 +- src/test/fixture/did/v4/did-signed.json | 50 + src/utils/shared.test.ts | 13 +- src/utils/shared.ts | 16 +- 6 files changed, 852 insertions(+), 319 deletions(-) create mode 100644 src/test/fixture/did/v4/did-signed.json diff --git a/package-lock.json b/package-lock.json index b6173d12c..690d3a947 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4432,11 +4432,6 @@ "fast-deep-equal": "^3.1.3" } }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, "body-parser": { "version": "1.20.1", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", @@ -4620,6 +4615,22 @@ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.4.0.tgz", "integrity": "sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==" }, + "html-webpack-plugin-4": { + "version": "npm:html-webpack-plugin@4.5.2", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz", + "integrity": "sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A==", + "requires": { + "@types/html-minifier-terser": "^5.0.0", + "@types/tapable": "^1.0.5", + "@types/webpack": "^4.41.8", + "html-minifier-terser": "^5.0.1", + "loader-utils": "^1.2.3", + "lodash": "^4.17.20", + "pretty-error": "^2.1.1", + "tapable": "^1.1.3", + "util.promisify": "1.0.0" + } + }, "html-webpack-plugin-5": { "version": "npm:html-webpack-plugin@5.5.3", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.5.3.tgz", @@ -4714,6 +4725,24 @@ "is-docker": "^2.0.0" } }, + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, "locate-path": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", @@ -4953,9 +4982,9 @@ } }, "terser": { - "version": "5.19.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", - "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "version": "5.19.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.4.tgz", + "integrity": "sha512-6p1DjHeuluwxDXcuT9VR8p64klWJKo1ILiy19s6C9+0Bh2+NWTX6nD9EPppiER4ICkHDVB1RkVpin/YW2nQn/g==", "requires": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -4963,15 +4992,6 @@ "source-map-support": "~0.5.20" }, "dependencies": { - "@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" - } - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -5158,11 +5178,11 @@ }, "dependencies": { "@babel/helper-module-imports": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", - "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", "requires": { - "@babel/types": "^7.22.5" + "@babel/types": "^7.22.15" } }, "@babel/helper-string-parser": { @@ -5171,25 +5191,25 @@ "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==" }, "@babel/helper-validator-identifier": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", - "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==" + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", + "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==" }, "@babel/runtime": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", - "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "requires": { "regenerator-runtime": "^0.14.0" } }, "@babel/types": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.11.tgz", - "integrity": "sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==", + "version": "7.22.17", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.17.tgz", + "integrity": "sha512-YSQPHLFtQNE5xN9tHuZnzu8vPr61wVTBZdfv1meex1NBosa4iT05k/Jw06ddJugi4bk7The/oSwQGFcksmEJQg==", "requires": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.15", "to-fast-properties": "^2.0.0" } }, @@ -5368,9 +5388,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", - "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -5430,9 +5450,9 @@ }, "dependencies": { "@babel/runtime": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", - "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "requires": { "regenerator-runtime": "^0.14.0" } @@ -6474,9 +6494,9 @@ } }, "@govtechsg/decentralized-renderer-react-components": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/@govtechsg/decentralized-renderer-react-components/-/decentralized-renderer-react-components-3.10.3.tgz", - "integrity": "sha512-IsPLu5uSzJxiZVYDuhVgO0pUp2nF09y6FYCjDyvpqiBWac8/oNWWKQHVlXttTmthLHNGbmLVRh0M5IskWrBqxQ==", + "version": "3.12.0-alpha.2", + "resolved": "https://registry.npmjs.org/@govtechsg/decentralized-renderer-react-components/-/decentralized-renderer-react-components-3.12.0-alpha.2.tgz", + "integrity": "sha512-Zx0eCdyDZ5oCGzo0uc9TuhAIT+swis0qUS3A1MQvDlF/xIrZ53vbhKOjRGBJgFySfheVAI7FHX1iCJiU7a89xQ==", "requires": { "@babel/runtime-corejs3": "^7.15.4", "@emotion/react": "^11.11.1", @@ -6484,7 +6504,7 @@ "@fortawesome/fontawesome-svg-core": "^1.2.35", "@fortawesome/free-solid-svg-icons": "^5.15.3", "@fortawesome/react-fontawesome": "^0.1.14", - "@govtechsg/open-attestation": "^6.6.0", + "@govtechsg/open-attestation": "6.8.0-alpha.1", "crypto-browserify": "^3.12.0", "debug": "^4.3.1", "penpal": "^5.3.0", @@ -6493,6 +6513,160 @@ "stream-browserify": "^3.0.0", "typesafe-actions": "^5.1.0" }, + "dependencies": { + "penpal-v4": { + "version": "npm:penpal@4.1.1", + "resolved": "https://registry.npmjs.org/penpal/-/penpal-4.1.1.tgz", + "integrity": "sha512-6d1f8khVLyBz3DnhLztbfjJ7+ANxdXRM2l6awpnCdEtbrmse4AGTsELOvGuNY0SU7xZw7heGbP6IikVvaVTOWw==" + } + } + }, + "@govtechsg/dnsprove": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@govtechsg/dnsprove/-/dnsprove-2.6.1.tgz", + "integrity": "sha512-ALLe3EC9ix6ZsMIHgRRLdVYMC35yRShG8sRXb73D4bvw60Yz/pT/Y3e9w40KqG8HMMChvJaEMV6uQi6GR7Jwmw==", + "requires": { + "axios": "^0.21.1", + "debug": "^4.3.1", + "runtypes": "^6.3.0" + }, + "dependencies": { + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + } + } + }, + "@govtechsg/document-store": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/@govtechsg/document-store/-/document-store-2.6.1.tgz", + "integrity": "sha512-Jr8dGyr8wBXMOSbUURoYfmz9jKiK2ntbjEYyI06pze6jzyiYLZXcepKVyjNk9PC/mLIlDCZgQWmre7ixBZWWjQ==" + }, + "@govtechsg/ethers-contract-hook": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@govtechsg/ethers-contract-hook/-/ethers-contract-hook-2.2.0.tgz", + "integrity": "sha512-vLH7rrlpeLXnp0tCwzrZMx6CUtIohqa18EuKP31vvL81X0qrn6xixtMmRfYMbUJ5iNa4u+VleyU/Ia/wh2tlPQ==", + "requires": { + "debug": "^4.1.1" + } + }, + "@govtechsg/jsonld": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@govtechsg/jsonld/-/jsonld-0.1.1.tgz", + "integrity": "sha512-G3mz6/ryS4tIWTV7FonallTuj4Oy2JjLkBdCn7wjKShb3AG3/PY6XCpNupz8+rpvDF5BGtYvptpW9HRArnjyMQ==", + "requires": { + "canonicalize": "^1.0.1", + "cross-fetch": "^3.1.4", + "lru-cache": "^6.0.0", + "rdf-canonize": "^3.0.0" + }, + "dependencies": { + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } + }, + "@govtechsg/oa-encryption": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@govtechsg/oa-encryption/-/oa-encryption-1.3.5.tgz", + "integrity": "sha512-wBraQPBBpvfwrJ2ujhrihHndIixjgFGK/AyNG6KjHaWMwN9TrOh0MD+JroL23+z8ku4uM2gZgszG18ui6Ikx3A==", + "requires": { + "debug": "4.3.4", + "node-forge": "1.3.1" + }, + "dependencies": { + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" + } + } + }, + "@govtechsg/oa-verify": { + "version": "8.3.0-alpha.1", + "resolved": "https://registry.npmjs.org/@govtechsg/oa-verify/-/oa-verify-8.3.0-alpha.1.tgz", + "integrity": "sha512-kGuVKuVf5J9a+7v7+SHxz0SeVt05b6ntA8AdABkryyY+7Ey5atBvCp8C+FRekXpQ6f/a0th9EDIOPAtOYCmmpA==", + "requires": { + "@govtechsg/dnsprove": "^2.6.1", + "@govtechsg/document-store": "^2.2.3", + "@govtechsg/open-attestation": "6.8.0-alpha.1", + "@govtechsg/token-registry": "^4.1.7", + "axios": "^0.21.4", + "debug": "^4.3.1", + "did-resolver": "^3.1.0", + "ethers": "^5.1.4", + "ethr-did-resolver": "^4.3.3", + "node-cache": "^5.1.2", + "runtypes": "^6.3.0", + "web-did-resolver": "^2.0.4" + }, + "dependencies": { + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + } + } + }, + "@govtechsg/open-attestation": { + "version": "6.8.0-alpha.1", + "resolved": "https://registry.npmjs.org/@govtechsg/open-attestation/-/open-attestation-6.8.0-alpha.1.tgz", + "integrity": "sha512-GJx9Ug0rbTxDi2k+RYZkMYoMS1+0SIC3j8VabZVPFZLe6LpWTCQhtDCsWsZmbuvPJX88WnRGmqLeTH40OUeR1Q==", + "requires": { + "@govtechsg/jsonld": "^0.1.0", + "ajv": "^8.6.2", + "ajv-formats": "^2.1.0", + "cross-fetch": "^3.1.5", + "debug": "^4.3.2", + "ethers": "^5.7.2", + "flatley": "^5.2.0", + "js-base64": "^3.6.1", + "js-sha3": "^0.8.0", + "lodash": "^4.17.21", + "runtypes": "^6.3.2", + "uuid": "^8.3.2", + "validator": "^13.7.0" + }, "dependencies": { "@ethersproject/abi": { "version": "5.7.0", @@ -6865,39 +7039,11 @@ "@ethersproject/strings": "^5.7.0" } }, - "@govtechsg/open-attestation": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@govtechsg/open-attestation/-/open-attestation-6.7.0.tgz", - "integrity": "sha512-kF0lnUyJ/YZI73kUvj1N7Hx3GGf3ncLo4Ax8WVSeup/uqJBoy3nAMdfZbmh9plsDcDMWAgHnVXrEyaxsKicxkA==", - "requires": { - "@govtechsg/jsonld": "^0.1.0", - "ajv": "^8.6.2", - "ajv-formats": "^2.1.0", - "cross-fetch": "^3.1.5", - "debug": "^4.3.2", - "ethers": "^5.7.2", - "flatley": "^5.2.0", - "js-base64": "^3.6.1", - "js-sha3": "^0.8.0", - "lodash": "^4.17.21", - "runtypes": "^6.3.2", - "uuid": "^8.3.2", - "validator": "^13.7.0" - } - }, "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==" }, - "cross-fetch": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", - "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", - "requires": { - "node-fetch": "^2.6.12" - } - }, "ethers": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", @@ -6935,187 +7081,6 @@ "@ethersproject/wordlists": "5.7.0" } }, - "js-sha3": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", - "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" - }, - "node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - } - }, - "@govtechsg/dnsprove": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@govtechsg/dnsprove/-/dnsprove-2.6.1.tgz", - "integrity": "sha512-ALLe3EC9ix6ZsMIHgRRLdVYMC35yRShG8sRXb73D4bvw60Yz/pT/Y3e9w40KqG8HMMChvJaEMV6uQi6GR7Jwmw==", - "requires": { - "axios": "^0.21.1", - "debug": "^4.3.1", - "runtypes": "^6.3.0" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" - } - } - }, - "@govtechsg/document-store": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@govtechsg/document-store/-/document-store-2.6.1.tgz", - "integrity": "sha512-Jr8dGyr8wBXMOSbUURoYfmz9jKiK2ntbjEYyI06pze6jzyiYLZXcepKVyjNk9PC/mLIlDCZgQWmre7ixBZWWjQ==" - }, - "@govtechsg/ethers-contract-hook": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@govtechsg/ethers-contract-hook/-/ethers-contract-hook-2.2.0.tgz", - "integrity": "sha512-vLH7rrlpeLXnp0tCwzrZMx6CUtIohqa18EuKP31vvL81X0qrn6xixtMmRfYMbUJ5iNa4u+VleyU/Ia/wh2tlPQ==", - "requires": { - "debug": "^4.1.1" - } - }, - "@govtechsg/jsonld": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@govtechsg/jsonld/-/jsonld-0.1.1.tgz", - "integrity": "sha512-G3mz6/ryS4tIWTV7FonallTuj4Oy2JjLkBdCn7wjKShb3AG3/PY6XCpNupz8+rpvDF5BGtYvptpW9HRArnjyMQ==", - "requires": { - "canonicalize": "^1.0.1", - "cross-fetch": "^3.1.4", - "lru-cache": "^6.0.0", - "rdf-canonize": "^3.0.0" - }, - "dependencies": { - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "requires": { - "yallist": "^4.0.0" - } - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } - }, - "@govtechsg/oa-encryption": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@govtechsg/oa-encryption/-/oa-encryption-1.3.5.tgz", - "integrity": "sha512-wBraQPBBpvfwrJ2ujhrihHndIixjgFGK/AyNG6KjHaWMwN9TrOh0MD+JroL23+z8ku4uM2gZgszG18ui6Ikx3A==", - "requires": { - "debug": "4.3.4", - "node-forge": "1.3.1" - }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==" - } - } - }, - "@govtechsg/oa-verify": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/@govtechsg/oa-verify/-/oa-verify-8.2.0.tgz", - "integrity": "sha512-iOB0UvGAaPpZWAKsY+RdxP8xP4ytL9TIVqfSsB1ejH6+Wsbnl+YB8Pk3ex1YZIEcoRvjyZOxZEdfXanvknoU8g==", - "requires": { - "@govtechsg/dnsprove": "^2.6.1", - "@govtechsg/document-store": "^2.2.3", - "@govtechsg/open-attestation": "^6.2.0", - "@govtechsg/token-registry": "^4.1.7", - "axios": "^0.21.4", - "debug": "^4.3.1", - "did-resolver": "^3.1.0", - "ethers": "^5.1.4", - "ethr-did-resolver": "^4.3.3", - "node-cache": "^5.1.2", - "runtypes": "^6.3.0", - "web-did-resolver": "^2.0.4" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" - } - } - }, - "@govtechsg/open-attestation": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@govtechsg/open-attestation/-/open-attestation-6.5.0.tgz", - "integrity": "sha512-1+4LcMVvCqdyMHWQ9XCWmIeCDybxq477o+lBnkx8knnaYUjw24///Z6JmQsYT0JCGg0yHafOoJWb3zSnyrSYpw==", - "requires": { - "@govtechsg/jsonld": "^0.1.0", - "ajv": "^8.6.2", - "ajv-formats": "^2.1.0", - "cross-fetch": "^3.1.4", - "debug": "^4.3.2", - "ethers": "^5.4.3", - "flatley": "^5.2.0", - "js-base64": "^3.6.1", - "js-sha3": "^0.8.0", - "lodash": "^4.17.21", - "runtypes": "^6.3.2", - "uuid": "^8.3.2", - "validator": "^13.6.0" - }, - "dependencies": { "js-sha3": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", @@ -7580,6 +7545,27 @@ } } }, + "@govtechsg/open-attestation": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@govtechsg/open-attestation/-/open-attestation-6.7.0.tgz", + "integrity": "sha512-kF0lnUyJ/YZI73kUvj1N7Hx3GGf3ncLo4Ax8WVSeup/uqJBoy3nAMdfZbmh9plsDcDMWAgHnVXrEyaxsKicxkA==", + "dev": true, + "requires": { + "@govtechsg/jsonld": "^0.1.0", + "ajv": "^8.6.2", + "ajv-formats": "^2.1.0", + "cross-fetch": "^3.1.5", + "debug": "^4.3.2", + "ethers": "^5.7.2", + "flatley": "^5.2.0", + "js-base64": "^3.6.1", + "js-sha3": "^0.8.0", + "lodash": "^4.17.21", + "runtypes": "^6.3.2", + "uuid": "^8.3.2", + "validator": "^13.7.0" + } + }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -8443,6 +8429,480 @@ "integrity": "sha512-mbLEGkE6Y9yJhkeHjLiM/oDyXF1PVnHqiyaonbWylq0lOf9Wbuhs6cjqKdfDyNlsg/mAhLSysyQnz7GyNVW/Zg==", "requires": { "@govtechsg/oa-verify": "^8.1.0" + }, + "dependencies": { + "@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "requires": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "requires": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "requires": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==" + }, + "@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "requires": { + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "requires": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "requires": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "requires": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "requires": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "requires": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "@govtechsg/oa-verify": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@govtechsg/oa-verify/-/oa-verify-8.2.0.tgz", + "integrity": "sha512-iOB0UvGAaPpZWAKsY+RdxP8xP4ytL9TIVqfSsB1ejH6+Wsbnl+YB8Pk3ex1YZIEcoRvjyZOxZEdfXanvknoU8g==", + "requires": { + "@govtechsg/dnsprove": "^2.6.1", + "@govtechsg/document-store": "^2.2.3", + "@govtechsg/open-attestation": "^6.2.0", + "@govtechsg/token-registry": "^4.1.7", + "axios": "^0.21.4", + "debug": "^4.3.1", + "did-resolver": "^3.1.0", + "ethers": "^5.1.4", + "ethr-did-resolver": "^4.3.3", + "node-cache": "^5.1.2", + "runtypes": "^6.3.0", + "web-did-resolver": "^2.0.4" + } + }, + "@govtechsg/open-attestation": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@govtechsg/open-attestation/-/open-attestation-6.7.0.tgz", + "integrity": "sha512-kF0lnUyJ/YZI73kUvj1N7Hx3GGf3ncLo4Ax8WVSeup/uqJBoy3nAMdfZbmh9plsDcDMWAgHnVXrEyaxsKicxkA==", + "requires": { + "@govtechsg/jsonld": "^0.1.0", + "ajv": "^8.6.2", + "ajv-formats": "^2.1.0", + "cross-fetch": "^3.1.5", + "debug": "^4.3.2", + "ethers": "^5.7.2", + "flatley": "^5.2.0", + "js-base64": "^3.6.1", + "js-sha3": "^0.8.0", + "lodash": "^4.17.21", + "runtypes": "^6.3.2", + "uuid": "^8.3.2", + "validator": "^13.7.0" + }, + "dependencies": { + "ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "requires": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + } + } + }, + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + }, + "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==" + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, + "js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + } } }, "@hapi/hoek": { @@ -9041,6 +9501,15 @@ "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==" }, + "@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", @@ -15505,6 +15974,11 @@ "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==" }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, "ansi-sequence-parser": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz", @@ -19448,17 +19922,39 @@ } }, "cross-fetch": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.4.tgz", - "integrity": "sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "requires": { - "node-fetch": "2.6.1" + "node-fetch": "^2.6.12" }, "dependencies": { "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } } } }, @@ -25100,42 +25596,6 @@ } } }, - "html-webpack-plugin-4": { - "version": "npm:html-webpack-plugin@4.5.2", - "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz", - "integrity": "sha512-q5oYdzjKUIPQVjOosjgvCHQOv9Ett9CYYHlgvJeXG0qQvdSojnBq4vAdQBwn1+yGveAwHCoe/rMR86ozX3+c2A==", - "requires": { - "@types/html-minifier-terser": "^5.0.0", - "@types/tapable": "^1.0.5", - "@types/webpack": "^4.41.8", - "html-minifier-terser": "^5.0.1", - "loader-utils": "^1.2.3", - "lodash": "^4.17.20", - "pretty-error": "^2.1.1", - "tapable": "^1.1.3", - "util.promisify": "1.0.0" - }, - "dependencies": { - "json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "requires": { - "minimist": "^1.2.0" - } - }, - "loader-utils": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", - "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - } - } - } - }, "htmlparser2": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", @@ -28222,9 +28682,9 @@ } }, "js-base64": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.2.tgz", - "integrity": "sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==" + "version": "3.7.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", + "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" }, "js-sha3": { "version": "0.5.7", @@ -31180,11 +31640,6 @@ "resolved": "https://registry.npmjs.org/penpal/-/penpal-5.3.0.tgz", "integrity": "sha512-ezGckenx66j3RShl4nZiswjgDxyoDaJJ9tLBp46UvVxlA9MlIPF6hWfuppw1AzaDKgUULU1i44QFOuI4SXY/mg==" }, - "penpal-v4": { - "version": "npm:penpal@4.1.1", - "resolved": "https://registry.npmjs.org/penpal/-/penpal-4.1.1.tgz", - "integrity": "sha512-6d1f8khVLyBz3DnhLztbfjJ7+ANxdXRM2l6awpnCdEtbrmse4AGTsELOvGuNY0SU7xZw7heGbP6IikVvaVTOWw==" - }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -32436,9 +32891,9 @@ } }, "rdf-canonize": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-3.0.0.tgz", - "integrity": "sha512-LXRkhab1QaPJnhUIt1gtXXKswQCZ9zpflsSZFczG7mCLAkMvVjdqCGk9VXCUss0aOUeEyV2jtFxGcdX8DSkj9w==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-3.4.0.tgz", + "integrity": "sha512-fUeWjrkOO0t1rg7B2fdyDTvngj+9RlUyL92vOdiB7c0FPguWVsniIMjEtHH+meLBO9rzkUlUzBVXgWrjI8P9LA==", "requires": { "setimmediate": "^1.0.5" } @@ -37817,9 +38272,9 @@ } }, "validator": { - "version": "13.7.0", - "resolved": "https://registry.npmjs.org/validator/-/validator-13.7.0.tgz", - "integrity": "sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==" + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.11.0.tgz", + "integrity": "sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==" }, "value-equal": { "version": "1.0.1", diff --git a/package.json b/package.json index 2abd40257..06223fa0f 100644 --- a/package.json +++ b/package.json @@ -47,12 +47,12 @@ }, "dependencies": { "@govtechsg/address-identity-resolver": "^1.5.0", - "@govtechsg/decentralized-renderer-react-components": "^3.10.3", + "@govtechsg/decentralized-renderer-react-components": "^3.12.0-alpha.2", "@govtechsg/document-store": "^2.6.1", "@govtechsg/ethers-contract-hook": "^2.2.0", "@govtechsg/oa-encryption": "^1.3.5", - "@govtechsg/oa-verify": "^8.2.0", - "@govtechsg/open-attestation": "^6.5.0", + "@govtechsg/oa-verify": "^8.3.0-alpha.1", + "@govtechsg/open-attestation": "^6.8.0-alpha.1", "@govtechsg/open-attestation-utils": "^1.0.9", "@govtechsg/token-registry": "^4.1.7", "@govtechsg/tradetrust-ui-components": "^2.21.0", diff --git a/src/components/DocumentStatus/DocumentStatus.tsx b/src/components/DocumentStatus/DocumentStatus.tsx index bb0877d6b..0f3b34f48 100644 --- a/src/components/DocumentStatus/DocumentStatus.tsx +++ b/src/components/DocumentStatus/DocumentStatus.tsx @@ -2,7 +2,7 @@ import { VerificationFragment, VerificationFragmentWithData, utils } from "@govt import React, { FunctionComponent } from "react"; import { StatusChecks } from "./StatusChecks"; import { useSelector } from "react-redux"; -import { utils as oaUtils, WrappedDocument, v3 } from "@govtechsg/open-attestation"; +import { utils as oaUtils, WrappedDocument, v3, v4 } from "@govtechsg/open-attestation"; import { RootState } from "../../reducers"; import { WrappedOrSignedOpenAttestationDocument } from "../../utils/shared"; @@ -49,6 +49,10 @@ export const getV3IdentityVerificationText = (document: WrappedDocument): string => { + return document.issuer.id.toUpperCase(); +}; + interface IssuedByProps { title?: string; verificationStatus: VerificationFragment[]; @@ -56,9 +60,14 @@ interface IssuedByProps { } export const IssuedBy: FunctionComponent = ({ title = "Issued by", verificationStatus, document }) => { - const formattedDomainNames = oaUtils.isWrappedV2Document(document) - ? getV2FormattedDomainNames(verificationStatus) - : getV3IdentityVerificationText(document); + let formattedDomainNames; + if (oaUtils.isWrappedV2Document(document)) { + formattedDomainNames = getV2FormattedDomainNames(verificationStatus); + } else if (oaUtils.isWrappedV3Document(document)) { + formattedDomainNames = getV3IdentityVerificationText(document); + } else { + formattedDomainNames = getV4IdentityVerificationText(document); + } return (

{title} diff --git a/src/test/fixture/did/v4/did-signed.json b/src/test/fixture/did/v4/did-signed.json new file mode 100644 index 000000000..f2efde6d6 --- /dev/null +++ b/src/test/fixture/did/v4/did-signed.json @@ -0,0 +1,50 @@ +{ + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://schemata.openattestation.com/com/openattestation/4.0/alpha-context.json" + ], + "type": ["VerifiableCredential", "OpenAttestationCredential"], + "validFrom": "2021-03-08T12:00:00+08:00", + "name": "Republic of Singapore Driving Licence", + "issuer": { + "id": "did:ethr:0xB26B4941941C51a4885E5B7D3A1B861E54405f90", + "type": "OpenAttestationIssuer", + "name": "Government Technology Agency of Singapore (GovTech)", + "identityProof": { "identityProofType": "DNS-DID", "identifier": "example.openattestation.com" } + }, + "credentialStatus": { "type": "OpenAttestationCredentialStatus", "credentialStatusType": "NONE" }, + "renderMethod": { + "type": "OpenAttestationRenderMethod", + "renderMethodType": "EMBEDDED_RENDERER", + "name": "GOVTECH_DEMO", + "url": "https://demo-renderer.openattestation.com" + }, + "credentialSubject": { + "id": "urn:uuid:a013fb9d-bb03-4056-b696-05575eceaf42", + "type": ["DriversLicense"], + "name": "John Doe", + "licenses": [ + { + "class": "3", + "description": "Motor cars with unladen weight <= 3000kg", + "effectiveDate": "2013-05-16T00:00:00+08:00" + }, + { + "class": "3A", + "description": "Motor cars with unladen weight <= 3000kg", + "effectiveDate": "2013-05-16T00:00:00+08:00" + } + ] + }, + "proof": { + "type": "OpenAttestationMerkleProofSignature2018", + "proofPurpose": "assertionMethod", + "targetHash": "adb16863b9b92f1f46d67f518f853092404dc1322ffb61b45a831ee113f4ea99", + "proofs": [], + "merkleRoot": "adb16863b9b92f1f46d67f518f853092404dc1322ffb61b45a831ee113f4ea99", + "salts": "W3sidmFsdWUiOiJkYTlkMTE5MTMxOWRjOTM4ZTQ2ZjZhYmMzMjU1NTM5NGYwYzEzNDIyMGUwYjgyMDY0NzBhYjlmNmYxN2QyZTJlIiwicGF0aCI6IkBjb250ZXh0WzBdIn0seyJ2YWx1ZSI6IjhhZDM5Njg2NGIwNGI5ZjYxY2I3ODNjY2M1YWEyNTYxODgxYmRiODZmZmI5ZmNjZjViYTQ1YzUyN2MwZGFmMGMiLCJwYXRoIjoiQGNvbnRleHRbMV0ifSx7InZhbHVlIjoiMjYwNDllNWExODQ4MDVlYTUxNjQ4OTM3OGI0NDZhNTdiMjdlZWU0YmFhN2VmYjBkNWM3OTcwMGMzZDI5OGM5MyIsInBhdGgiOiJ0eXBlWzBdIn0seyJ2YWx1ZSI6IjU3N2M2ZGUzMzYzZmE1ZjA2ZDc5NjQyMjAxNTk3ODkzYzdmNDg3NWZlYzFiZTYyOWIxZWRkNTdhZWFlOTE3YzkiLCJwYXRoIjoidHlwZVsxXSJ9LHsidmFsdWUiOiI0NmMyOTY5MTVkZWVhNDMwMDNmY2ZmNjc3NzUxNTc3Zjg2MTdlODliYjBjNDhiNzIwMTdlMzRkOWNhNTM0ZGNlIiwicGF0aCI6InZhbGlkRnJvbSJ9LHsidmFsdWUiOiIwZWQ1Yzg0OTBlYjg2YWM5YmEyNGJlYzc3OTE2MThhZWZjZGE2M2M3OGNmZDJlMTdjMWNlNDRmNzVmZjU3NjljIiwicGF0aCI6Im5hbWUifSx7InZhbHVlIjoiMzEyNGUxNzc4Y2EzYTc2ZmI0MjUxNGExMmIzNDYzYmY4ZmY4NjNiNDdiZTExNDYyY2RiMGRiNzRmMzk1ZjViYiIsInBhdGgiOiJpc3N1ZXIuaWQifSx7InZhbHVlIjoiYTJmNTJhNTdmMWM5MDJhYzQ5MmJiNzc0YTQzOTIxYjk2NWJlM2VmZjRjNTBjMDhiNDhhNjJkOGZkNjNhMWQ1NCIsInBhdGgiOiJpc3N1ZXIudHlwZSJ9LHsidmFsdWUiOiI0NGZhZWFhNmIxYmZlZmI0NGM4NzJlYzI2Nzc4OWNkNzUwM2U3YTQ1YjZjMDdmMmE0MmJkMDE5OWU1NzI0ZjM1IiwicGF0aCI6Imlzc3Vlci5uYW1lIn0seyJ2YWx1ZSI6IjJjNzg1Y2NhOGMyODdhZjhmOGM1NWM4MmJkODI3ZGY4M2YyZDIxY2M4MTVhZWJlYTg5MmVjOTZmNGRmMzVkNzAiLCJwYXRoIjoiaXNzdWVyLmlkZW50aXR5UHJvb2YuaWRlbnRpdHlQcm9vZlR5cGUifSx7InZhbHVlIjoiOWM0OWNiOGQ1Njc2NjljOTEzMDEwYzE3MmI2YmM5N2Q4MTVlOWZlOGY3Mjg2ZWE0NzA3NWVhNDQxYzc4NmYwMyIsInBhdGgiOiJpc3N1ZXIuaWRlbnRpdHlQcm9vZi5pZGVudGlmaWVyIn0seyJ2YWx1ZSI6IjJjZDcxMmFlZTdjZDlkZmI1NjBmYzBjNWVjZmZhY2FkYzkzYmYzZmI1MGRhYTgyYTk2ZTQzYjA5OGU2OTg4YTEiLCJwYXRoIjoiY3JlZGVudGlhbFN0YXR1cy50eXBlIn0seyJ2YWx1ZSI6ImM4MmUwNmU1NWI1YTY2YmUwNTk5NjVjZDI5YTUzZWE1ODg0YjM3NjU0NWE4ZmMwMzNiMTEwNWE0MzMyMWI5ZjAiLCJwYXRoIjoiY3JlZGVudGlhbFN0YXR1cy5jcmVkZW50aWFsU3RhdHVzVHlwZSJ9LHsidmFsdWUiOiJiNzBkMTU5MmU4ZTk3NDlkNGU5ZTEzNjg5NTgxNjhlY2MxZWQ2ODE5NWQzMmE4YmI1MDdlOTc3NGU3ZjkxMGFlIiwicGF0aCI6InJlbmRlck1ldGhvZC50eXBlIn0seyJ2YWx1ZSI6IjIxMGI0NGNjYTdmYzZkOTY4ZDk2ZmVjZWY3MGQzNTU1ZDY5MjViYWEwNjA4ZTczMDM3YjBiOGI5Njc4MTQ0ZGEiLCJwYXRoIjoicmVuZGVyTWV0aG9kLnJlbmRlck1ldGhvZFR5cGUifSx7InZhbHVlIjoiODQyZDBhZTQ1ZTI5N2U1YzgyMmJhZWVjMGMxNDg5MGYyNzkwZjNhNzY1M2JkMTAwNzI5YWJiNTM5NzAxMGY3NCIsInBhdGgiOiJyZW5kZXJNZXRob2QubmFtZSJ9LHsidmFsdWUiOiI4ZDIyYmIwMzJlMjg1N2RlYTk3NDU4ZWZmMjQ5ODgxZGZiZmE2MmUxNDU0MzBkZTdmNWIzZThkNWM5NGVjNmY4IiwicGF0aCI6InJlbmRlck1ldGhvZC51cmwifSx7InZhbHVlIjoiNGJiNWMyMzliNzBmZmI2NDkwYmY4MmQwZTBjODQ3ZWE0YWIyYTQyYWU1MmZjMDljZjA0ZjFiMTg1YjQ5ODFmMyIsInBhdGgiOiJjcmVkZW50aWFsU3ViamVjdC5pZCJ9LHsidmFsdWUiOiJkOGJmNmI3NzRlNjY0MGU2MWIwMmY4MmIzNTM5Y2RhMjdjODkyNmVlNjI0ZDE1ODZlOTZlMzhjZjNkMWQ0MjY1IiwicGF0aCI6ImNyZWRlbnRpYWxTdWJqZWN0LnR5cGVbMF0ifSx7InZhbHVlIjoiYTViNjg5NThkOTNiZmM3Y2M0ZDYzM2IxODViZTRlZGNmMGFmZTkwOGRhYjIwOTI3N2RhOGQ3Nzg2ZTc0MjQ3ZCIsInBhdGgiOiJjcmVkZW50aWFsU3ViamVjdC5uYW1lIn0seyJ2YWx1ZSI6IjNlMjUyNTkwMmI1MDY3ZjZiMjNhZGFjYmNmMzdiOTBjNTY1N2ViZWY1ZTQwZmQ2ZTNlMGM1N2QyYjBhODFlMmYiLCJwYXRoIjoiY3JlZGVudGlhbFN1YmplY3QubGljZW5zZXNbMF0uY2xhc3MifSx7InZhbHVlIjoiODViZDZjYzhkODI4OTRlNWI0OGQ2NmI5ZTM2NGU4MTRhMzIxMWM4ODI0NGVhNmFlZDhkZTYzNWQ1YmFhODljMCIsInBhdGgiOiJjcmVkZW50aWFsU3ViamVjdC5saWNlbnNlc1swXS5kZXNjcmlwdGlvbiJ9LHsidmFsdWUiOiJiZWRlZDA0Yjk1MDEzZjBkNjgzZjZmNGI1YmI2ZDBjNjRjMDM0MjUxYjYwOWQwOTNkZGM0ZDE0Njg2MWJkMjVlIiwicGF0aCI6ImNyZWRlbnRpYWxTdWJqZWN0LmxpY2Vuc2VzWzBdLmVmZmVjdGl2ZURhdGUifSx7InZhbHVlIjoiYzQ2ZTBhMzkyYTExMmM1NjRkNDdmODQ5NmFhMGRiYmZmZTg1NGEwNDQxODAxZmYxNzYyNzBiYmMyYmUxN2MwOSIsInBhdGgiOiJjcmVkZW50aWFsU3ViamVjdC5saWNlbnNlc1sxXS5jbGFzcyJ9LHsidmFsdWUiOiJjMGYzMWI2MGYyMjVkZTg1M2YzNzAyYzk4Y2E1OTk0Y2EzNTcyNmUwZTAyNGZkNzRkMWUwZTM1NzZiYjRhNmZlIiwicGF0aCI6ImNyZWRlbnRpYWxTdWJqZWN0LmxpY2Vuc2VzWzFdLmRlc2NyaXB0aW9uIn0seyJ2YWx1ZSI6IjY0YTUxYjRkMmE3OWMyZTI5NTdkOTg0MDkwN2Q3MGEzMzY4NDRiN2QyYzNlNmE5NDk3NzY1NGUwM2RkMzk1ZWMiLCJwYXRoIjoiY3JlZGVudGlhbFN1YmplY3QubGljZW5zZXNbMV0uZWZmZWN0aXZlRGF0ZSJ9XQ==", + "privacy": { "obfuscated": [] }, + "key": "did:ethr:0xB26B4941941C51a4885E5B7D3A1B861E54405f90#controller", + "signature": "0xf5743ee83429b0ff71ca40d61f59b9c26f1fc220c2e9a4620bc73128acc0bb2b74764c561058327b19c6992ae6c2a543dd40c7c7e359df48a209477e3cea5bbe1c" + } +} diff --git a/src/utils/shared.test.ts b/src/utils/shared.test.ts index 7fcc8f21c..511962b79 100644 --- a/src/utils/shared.test.ts +++ b/src/utils/shared.test.ts @@ -1,8 +1,9 @@ import v3DID from "../test/fixture/did/dns-did-signed.json"; import v2DID from "../test/fixture/did/dns-did-verified.json"; +import v4DID from "../test/fixture/did/v4/did-signed.json"; import invoiceV2 from "../test/fixture/local/v2/invoice.json"; import invoiceV3 from "../test/fixture/local/v3/invoice.json"; -import { getChainId, WrappedOrSignedOpenAttestationDocument } from "./shared"; +import { getAttachments, getChainId, getTemplateUrl, WrappedOrSignedOpenAttestationDocument } from "./shared"; describe("getChainId for v2 document", () => { it("should return the correct chainId for sepolia", () => { @@ -115,3 +116,13 @@ describe("getChainId for v3 document", () => { expect(getChainId(v3DID as unknown as WrappedOrSignedOpenAttestationDocument)).toStrictEqual(undefined); }); }); + +describe("getTemplateUrl for v4", () => { + expect(getTemplateUrl(v4DID as WrappedOrSignedOpenAttestationDocument)).toBe( + "https://demo-renderer.openattestation.com" + ); +}); + +describe("getAttachments for v4", () => { + expect(getAttachments(v4DID as WrappedOrSignedOpenAttestationDocument)).toStrictEqual([]); +}); diff --git a/src/utils/shared.ts b/src/utils/shared.ts index 2bce7c1c4..ac707530f 100644 --- a/src/utils/shared.ts +++ b/src/utils/shared.ts @@ -14,8 +14,10 @@ export const getTemplateUrl = (rawDocument: WrappedOrSignedOpenAttestationDocume if (utils.isWrappedV2Document(rawDocument)) { const documentData = getData(rawDocument); return typeof documentData.$template === "object" ? documentData.$template.url : undefined; - } else { + } else if (utils.isWrappedV3Document(rawDocument)) { return rawDocument.openAttestationMetadata.template?.url; + } else { + return rawDocument.renderMethod?.url; } }; @@ -23,7 +25,7 @@ export const getAttachments = (rawDocument: WrappedOrSignedOpenAttestationDocume if (utils.isWrappedV2Document(rawDocument)) { const documentData = getData(rawDocument); return documentData.attachments; - } else { + } else if (utils.isWrappedV3Document(rawDocument)) { return rawDocument.attachments?.map((attachment: v3.Attachment) => { return { data: attachment.data, @@ -31,6 +33,9 @@ export const getAttachments = (rawDocument: WrappedOrSignedOpenAttestationDocume type: attachment.mimeType, }; }); + } else { + // attachments not included in v4 schema for now. + return []; } }; @@ -44,7 +49,7 @@ export const getChainId = (rawDocument: WrappedOrSignedOpenAttestationDocument): throw new Error("Invalid Document, please use a valid document."); }; - const processChainId = (document: OpenAttestationDocument): number | undefined => { + function processChainId(document: v2.OpenAttestationDocument | v3.OpenAttestationDocument): number | undefined { if (document.network) { // Check for current blockchain, "ETH" or "MATIC", and chainId, if need cater for other blockchain and network, update this accordingly. if (AvailableBlockChains.includes(document.network.chain) && document.network.chainId) { @@ -60,7 +65,7 @@ export const getChainId = (rawDocument: WrappedOrSignedOpenAttestationDocument): "You are using an older version of Open-Attestation Document, to use the auto network feature, please use an updated version. Otherwise, please make sure that you select the correct network." ); return undefined; - }; + } if (utils.isWrappedV2Document(rawDocument)) { const documentData = getData(rawDocument); @@ -73,5 +78,8 @@ export const getChainId = (rawDocument: WrappedOrSignedOpenAttestationDocument): const identityProofType = rawDocument.openAttestationMetadata.identityProof.type; if (identityProofType === "DNS-DID" || identityProofType === "DID") return undefined; return processChainId(rawDocument); + } else { + // for now v4 is only DID method so ignore chainID + return undefined; } };