From 6a4392dbcbeedd2a664a4199c4d9e621b6f790bc Mon Sep 17 00:00:00 2001 From: rongquan1 <85145303+rongquan1@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:10:15 +0800 Subject: [PATCH] feat: removal of hedera network (#352) --- package-lock.json | 255 +++-- package.json | 14 +- scripts/setup-contracts.js | 23 - src/common/config/validate.tsx | 2 - src/constants/chainInfo.tsx | 34 - .../v2/sample-config-hederatestnet.json | 984 ------------------ .../v3/sample-config-hederatestnet.json | 773 -------------- src/types/index.d.ts | 2 - src/utils/utils.test.tsx | 8 - 9 files changed, 201 insertions(+), 1894 deletions(-) delete mode 100644 src/test/fixtures/config/v2/sample-config-hederatestnet.json delete mode 100644 src/test/fixtures/config/v3/sample-config-hederatestnet.json diff --git a/package-lock.json b/package-lock.json index 4f38810b..3caef7ea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,13 +16,13 @@ "@hapi/joi": "^17.1.1", "@rjsf/core": "^3.1.0", "@tradetrust-tt/decentralized-renderer-react-components": "^3.14.3", - "@tradetrust-tt/dnsprove": "^2.14.2", - "@tradetrust-tt/document-store": "^2.7.0", - "@tradetrust-tt/token-registry": "^4.12.1", - "@tradetrust-tt/tradetrust": "^6.9.4", - "@tradetrust-tt/tradetrust-cli": "^2.22.1", - "@tradetrust-tt/tradetrust-ui-components": "^2.22.2", - "@tradetrust-tt/tradetrust-utils": "^1.14.1", + "@tradetrust-tt/dnsprove": "^2.15.0", + "@tradetrust-tt/document-store": "^4.1.0", + "@tradetrust-tt/token-registry": "^4.15.0", + "@tradetrust-tt/tradetrust": "^6.9.7", + "@tradetrust-tt/tradetrust-cli": "^2.23.0", + "@tradetrust-tt/tradetrust-ui-components": "^3.0.0", + "@tradetrust-tt/tradetrust-utils": "^1.14.3", "@tradetrust-tt/tt-verify": "^8.10.2", "ajv": "^8.6.0", "axios": "^1.7.2", @@ -137,6 +137,11 @@ "integrity": "sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==", "dev": true }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" + }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", @@ -4955,6 +4960,11 @@ "scrypt-js": "3.0.1" } }, + "node_modules/@ethersproject/json-wallets/node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + }, "node_modules/@ethersproject/keccak256": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", @@ -10914,9 +10924,9 @@ } }, "node_modules/@tradetrust-tt/dnsprove": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/dnsprove/-/dnsprove-2.14.2.tgz", - "integrity": "sha512-wXoLzlOzFilIvSXvHIODv6vR9MLHcJS5681Ic+nwlTgiHOKOg29vPX/h3Dl4YrcKgiHZwH2p/VbtcUJeSDYOgA==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/dnsprove/-/dnsprove-2.15.0.tgz", + "integrity": "sha512-e7VZoaPL1B7ishBsSxvMuHahDqxX48PDiqKtkNzzKg3CF4K2yM+I55XVpyQG+O5sfQswJXVr4iACIZ0lG20VOA==", "dependencies": { "axios": "1.7.2", "debug": "^4.3.1", @@ -10927,14 +10937,17 @@ } }, "node_modules/@tradetrust-tt/document-store": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/document-store/-/document-store-2.7.0.tgz", - "integrity": "sha512-wMTQkZ4FNzYvlWwaeKCHuV8fYxw+kefI38dTMHY5fpV3B5oaapePFGKHDs+4IrV1ZVFHQbqR/r/MP7dNwwjJDA==" + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/document-store/-/document-store-4.1.0.tgz", + "integrity": "sha512-8q1zX8iWkOcIPpVovhdeuCetbAFh9ROlx0iItszp+vcDYVXzVhPeC9ynl0zOLknvyeaaMptdOmT1RE5TDLs1BA==", + "engines": { + "node": ">=18.x" + } }, "node_modules/@tradetrust-tt/token-registry": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/token-registry/-/token-registry-4.12.1.tgz", - "integrity": "sha512-GM/q+pyRSzoRAaHuIxt1W/tr45JXv1CPMwF4nYIZhofDtVJTbLIeQsEnBpzJSyCp4hSQUe1LDAI3ma6SZRMq8A==", + "version": "4.15.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/token-registry/-/token-registry-4.15.0.tgz", + "integrity": "sha512-hwi/a8O1ng1Zj+gleg/9HaaggDGe8xxeVB0ghfVctrPFW93YXgPBlrGNPPox/02DmiMOSe5QDxYpRq7ZWgtwfA==", "dependencies": { "@typechain/ethers-v5": "10.2.1" }, @@ -10942,10 +10955,26 @@ "ethers": ">=5.0.8" } }, + "node_modules/@tradetrust-tt/token-registry/node_modules/@typechain/ethers-v5": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz", + "integrity": "sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A==", + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.0.0", + "@ethersproject/providers": "^5.0.0", + "ethers": "^5.1.3", + "typechain": "^8.1.1", + "typescript": ">=4.3.0" + } + }, "node_modules/@tradetrust-tt/tradetrust": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust/-/tradetrust-6.9.6.tgz", - "integrity": "sha512-UyG+4dzzp8t79so7YXAKh9YxoyfJ89mtodkYwxZg8rp0qY5YPSKjRS5Df79SxTJsmUCRTvJrAlJfFhGZ7v8HOg==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust/-/tradetrust-6.9.7.tgz", + "integrity": "sha512-fohB+lnH/1SVLlSeHKPh34wnj3FAUQcuBxgoFFcQVISgTP/GTOZVyIocCzfoMW4X/SDdmN/bdIXqHgEAR0HV/A==", "hasInstallScript": true, "dependencies": { "@govtechsg/jsonld": "^0.1.1", @@ -10963,22 +10992,22 @@ "validator": "^13.11.0" }, "engines": { - "node": "18.x" + "node": ">=18.x" } }, "node_modules/@tradetrust-tt/tradetrust-cli": { - "version": "2.22.1", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-cli/-/tradetrust-cli-2.22.1.tgz", - "integrity": "sha512-JYaTySl2nZv3igb/qlqVzxhugp09VmBksr4xvWd9hopEJ8iGf/Y67knP2SMph3TEgIZj8BepJYvH1pg6uj432Q==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-cli/-/tradetrust-cli-2.23.0.tgz", + "integrity": "sha512-KUDnPHo+38JJc544qMDrFeLKd36kn9tbr08PaIi/rScY4qwwpHdKg6AAHEQE3VTzkh4aVI3uwxDqu0AmdQhzlA==", "dependencies": { "@govtechsg/oa-encryption": "^1.3.3", "@snyk/protect": "^1.1196.0", - "@tradetrust-tt/dnsprove": "^2.14.2", - "@tradetrust-tt/document-store": "^2.7.0", - "@tradetrust-tt/token-registry": "^4.12.1", - "@tradetrust-tt/tradetrust": "^6.9.6", - "@tradetrust-tt/tradetrust-config": "^1.15.1", - "@tradetrust-tt/tt-verify": "^8.10.2", + "@tradetrust-tt/dnsprove": "^2.15.0", + "@tradetrust-tt/document-store": "^4.1.0", + "@tradetrust-tt/token-registry": "^4.15.0", + "@tradetrust-tt/tradetrust": "^6.9.7", + "@tradetrust-tt/tradetrust-config": "^1.16.0", + "@tradetrust-tt/tt-verify": "^9.2.0", "ajv": "^8.4.0", "ajv-formats": "^2.1.0", "chalk": "^4.1.2", @@ -11000,6 +11029,96 @@ "node": "18.x" } }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@tradetrust-tt/tt-verify": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tt-verify/-/tt-verify-9.2.0.tgz", + "integrity": "sha512-DmmRdERLk8imixPJh+1gs9T9PE3DYCou+84sk8f+3Dp2e8owqg8wD67Sa1Rzi0rd5J19H2M9aEYiRzSIHG05xg==", + "dependencies": { + "@tradetrust-tt/dnsprove": "^2.15.0", + "@tradetrust-tt/document-store": "^4.1.0", + "@tradetrust-tt/token-registry": "^5.1.0", + "@tradetrust-tt/tradetrust": "^6.9.7", + "axios": "^1.7.2", + "debug": "^4.3.1", + "did-resolver": "^3.1.0", + "ethers": "^5.7.2", + "ethr-did-resolver": "^4.3.3", + "node-cache": "^5.1.2", + "runtypes": "^6.3.0", + "web-did-resolver": "^2.0.4" + }, + "engines": { + "node": ">=18.x" + }, + "peerDependencies": { + "ethers": "^5.7.2" + } + }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@tradetrust-tt/tt-verify/node_modules/@tradetrust-tt/token-registry": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/token-registry/-/token-registry-5.1.0.tgz", + "integrity": "sha512-FfOJZMfNfsIdPRCsVB/P3LE9BTO0/kx7QfmNB7/Wfja8kwMspy3v55TvQ93B6nXBSp+VMvUOsNLd1ly7V4D7dg==", + "dependencies": { + "ethers": "^6.13.4" + } + }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@tradetrust-tt/tt-verify/node_modules/@tradetrust-tt/token-registry/node_modules/ethers": { + "version": "6.13.4", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.4.tgz", + "integrity": "sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "dependencies": { + "undici-types": "~6.19.2" + } + }, "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -11184,6 +11303,11 @@ "node": ">=8" } }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -11197,6 +11321,26 @@ "node": ">=8" } }, + "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@tradetrust-tt/tradetrust-cli/node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", @@ -11223,9 +11367,9 @@ } }, "node_modules/@tradetrust-tt/tradetrust-config": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-config/-/tradetrust-config-1.15.1.tgz", - "integrity": "sha512-srO2N3zdmP8pJ1MlMzjKKcsl+vo+EEJwhpXgeh6taEqmMNzkIyYhYYVp0E1B4156S3ZxAk5pyCSaEAqk4Ke/Vw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-config/-/tradetrust-config-1.16.0.tgz", + "integrity": "sha512-HUgm+Oy5wCHAntOME+n4JoCU+AA8B8YTnQHyoXCJtPMqDFFetj6oXhcHiaVJoC162HiHbgcWGBtk9uODe1Bdtg==", "dependencies": { "ajv": "^8.12.0", "ajv-formats": "^2.1.1", @@ -11238,9 +11382,9 @@ } }, "node_modules/@tradetrust-tt/tradetrust-ui-components": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-ui-components/-/tradetrust-ui-components-2.22.2.tgz", - "integrity": "sha512-aYjQxMURo+NcLv1AvwXh+8h8DCGgM2STlpdYkS6AW4+2pdgB4yemhftdVMlZIJ90y1OAACkGWfiextFRP01wEQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-ui-components/-/tradetrust-ui-components-3.0.0.tgz", + "integrity": "sha512-8cxDG0yNHj9b8T0JgXO4l03npCBS8QcD1XBPjziHiSIiQND10tWM6Q4JdHVTtVpHjoHNzGkNe9StmKZi3ig4iQ==", "dependencies": { "@govtechsg/address-identity-resolver": "^1.5.0", "debug": "^4.3.4", @@ -11255,14 +11399,14 @@ } }, "node_modules/@tradetrust-tt/tradetrust-utils": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-utils/-/tradetrust-utils-1.14.1.tgz", - "integrity": "sha512-Z81ungxVzO471Lp18/u1phgKkcXOyU8LGp+3Yt/6761fLECi2OtBySx6WrrxMpjzWLuIfZqFrj/gxkd6IipJmg==", + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/tradetrust-utils/-/tradetrust-utils-1.14.3.tgz", + "integrity": "sha512-UF+oDt3vViJF01pfwzaOi5W15yd6MpUv3yxrcwe7I+b24fmQIyMJq0TtaYgJ+/ts0XJBibP5tW4vZwrWcM9/dA==", "dependencies": { "@tradetrust-tt/tt-verify": "^8.10.2" }, "engines": { - "node": "18.x" + "node": ">=18.x" } }, "node_modules/@tradetrust-tt/tradetrust/node_modules/js-sha3": { @@ -11292,6 +11436,11 @@ "node": ">=18.x" } }, + "node_modules/@tradetrust-tt/tt-verify/node_modules/@tradetrust-tt/document-store": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@tradetrust-tt/document-store/-/document-store-2.7.0.tgz", + "integrity": "sha512-wMTQkZ4FNzYvlWwaeKCHuV8fYxw+kefI38dTMHY5fpV3B5oaapePFGKHDs+4IrV1ZVFHQbqR/r/MP7dNwwjJDA==" + }, "node_modules/@trysound/sax": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz", @@ -11325,22 +11474,6 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "devOptional": true }, - "node_modules/@typechain/ethers-v5": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/@typechain/ethers-v5/-/ethers-v5-10.2.1.tgz", - "integrity": "sha512-n3tQmCZjRE6IU4h6lqUGiQ1j866n5MTCBJreNEHHVWXa2u9GJTaeYyU1/k+1qLutkyw+sS6VAN+AbeiTqsxd/A==", - "dependencies": { - "lodash": "^4.17.15", - "ts-essentials": "^7.0.1" - }, - "peerDependencies": { - "@ethersproject/abi": "^5.0.0", - "@ethersproject/providers": "^5.0.0", - "ethers": "^5.1.3", - "typechain": "^8.1.1", - "typescript": ">=4.3.0" - } - }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -12879,9 +13012,9 @@ } }, "node_modules/aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" }, "node_modules/agent-base": { "version": "6.0.2", @@ -39888,9 +40021,9 @@ } }, "node_modules/tslib": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" }, "node_modules/tsutils": { "version": "3.21.0", diff --git a/package.json b/package.json index 0b9862ba..922136a5 100644 --- a/package.json +++ b/package.json @@ -55,13 +55,13 @@ "@hapi/joi": "^17.1.1", "@rjsf/core": "^3.1.0", "@tradetrust-tt/decentralized-renderer-react-components": "^3.14.3", - "@tradetrust-tt/dnsprove": "^2.14.2", - "@tradetrust-tt/document-store": "^2.7.0", - "@tradetrust-tt/token-registry": "^4.12.1", - "@tradetrust-tt/tradetrust": "^6.9.4", - "@tradetrust-tt/tradetrust-cli": "^2.22.1", - "@tradetrust-tt/tradetrust-ui-components": "^2.22.2", - "@tradetrust-tt/tradetrust-utils": "^1.14.1", + "@tradetrust-tt/dnsprove": "^2.15.0", + "@tradetrust-tt/document-store": "^4.1.0", + "@tradetrust-tt/token-registry": "^4.15.0", + "@tradetrust-tt/tradetrust": "^6.9.7", + "@tradetrust-tt/tradetrust-cli": "^2.23.0", + "@tradetrust-tt/tradetrust-ui-components": "^3.0.0", + "@tradetrust-tt/tradetrust-utils": "^1.14.3", "@tradetrust-tt/tt-verify": "^8.10.2", "ajv": "^8.6.0", "axios": "^1.7.2", diff --git a/scripts/setup-contracts.js b/scripts/setup-contracts.js index 09d290ec..dd9e16bd 100644 --- a/scripts/setup-contracts.js +++ b/scripts/setup-contracts.js @@ -29,26 +29,3 @@ merkleRootToIssue.forEach((hash) => { `${CLI_PATH} document-store issue --address ${DOCUMENT_STORE_ADDRESS} --hash ${hash} -n local -k ${ACCOUNT_KEY}` ); }); - -const ACCOUNT_KEY_HEDERA_TESTNET = "0xe82294532bcfcd8e0763ee5cef194f36f00396be59b94fb418f5f8d83140d9a7"; -const DOCUMENT_STORE_ADDRESS_HEDERA_TESTNET = "0x4Bf7E4777a8D1b6EdD5F2d9b8582e2817F0B0953"; - -const TITLE_ESCROW_FACTORY_ADDRESS_HEDERA_TESTNET = "0x63A223E025256790E88778a01f480eBA77731D04"; - -// Need to deploy as it will use the 1st contract address: 0x63a223e025256790e88778a01f480eba77731d04 -shell.exec(`${CLI_PATH} deploy title-escrow-factory -n hederatestnet -k ${ACCOUNT_KEY_HEDERA_TESTNET}`); - -shell.exec( - `${CLI_PATH} deploy token-registry "DEMO TOKEN REGISTRY" DTR -n hederatestnet -k ${ACCOUNT_KEY_HEDERA_TESTNET} --factory-address ${TITLE_ESCROW_FACTORY_ADDRESS_HEDERA_TESTNET} --standalone` -); - -shell.exec(`${CLI_PATH} deploy document-store "My Document Store" -n hederatestnet -k ${ACCOUNT_KEY_HEDERA_TESTNET}`); - -const merkleRootToIssueHederaTestnet = ["0xbc4f35f03982a760505785d62565e29b88377db1243b273bd598e4763bacb83c"]; - -// Issue a verifiable document for revoke flow -merkleRootToIssueHederaTestnet.forEach((hash) => { - shell.exec( - `${CLI_PATH} document-store issue --address ${DOCUMENT_STORE_ADDRESS_HEDERA_TESTNET} --hash ${hash} -n hederatestnet -k ${ACCOUNT_KEY_HEDERA_TESTNET}` - ); -}); diff --git a/src/common/config/validate.tsx b/src/common/config/validate.tsx index f24ac4c4..dfa5124a 100644 --- a/src/common/config/validate.tsx +++ b/src/common/config/validate.tsx @@ -11,8 +11,6 @@ const configFileSchema = Joi.object({ "amoy", "xdc", "xdcapothem", - "hederamainnet", - "hederatestnet", "stabilitytestnet", "stability", "astron" diff --git a/src/constants/chainInfo.tsx b/src/constants/chainInfo.tsx index efdf229d..d468bc30 100644 --- a/src/constants/chainInfo.tsx +++ b/src/constants/chainInfo.tsx @@ -34,10 +34,6 @@ export enum ChainId { XDC = 50, XDCApothem = 51, - // Hedera Network - HederaMainnet = 295, - HederaTestnet = 296, - // Stability Network StabilityTestnet = 20180427, Stability = 101010, @@ -131,34 +127,6 @@ export const ChainInfo: ChainInfo = { decimals: 18, }, }, - [ChainId.HederaMainnet]: { - label: "Hedera Network Mainnet", - chain: "Hedera", - chainId: ChainId.HederaMainnet, - networkName: "hederamainnet", - explorerUrl: "https://hashscan.io/mainnet", - explorerApiUrl: "https://hashscan.io/mainnet", - rpcUrl: "https://mainnet.hashio.io/api", - nativeCurrency: { - name: "HBAR", - symbol: "HBAR", - decimals: 18, - }, - }, - [ChainId.HederaTestnet]: { - label: "Hedera Network TestNet", - chain: "Hedera", - chainId: ChainId.HederaTestnet, - networkName: "hederatestnet", - explorerUrl: "https://hashscan.io/testnet", - explorerApiUrl: "https://hashscan.io/testnet", - rpcUrl: "https://testnet.hashio.io/api", - nativeCurrency: { - name: "HBAR", - symbol: "HBAR", - decimals: 18, - }, - }, [ChainId.StabilityTestnet]: { label: "Stability Network TestNet", chain: "FREE", @@ -207,7 +175,6 @@ export const supportedMainnet = [ ChainInfo[ChainId.Ethereum].networkName, ChainInfo[ChainId.Polygon].networkName, ChainInfo[ChainId.XDC].networkName, - ChainInfo[ChainId.HederaMainnet].networkName, ChainInfo[ChainId.Stability].networkName, ChainInfo[ChainId.Astron].networkName, ]; @@ -216,7 +183,6 @@ export const supportedTestnet = [ ChainInfo[ChainId.Sepolia].networkName, ChainInfo[ChainId.Amoy].networkName, ChainInfo[ChainId.XDCApothem].networkName, - ChainInfo[ChainId.HederaTestnet].networkName, ChainInfo[ChainId.StabilityTestnet].networkName, ]; diff --git a/src/test/fixtures/config/v2/sample-config-hederatestnet.json b/src/test/fixtures/config/v2/sample-config-hederatestnet.json deleted file mode 100644 index 8de9b33c..00000000 --- a/src/test/fixtures/config/v2/sample-config-hederatestnet.json +++ /dev/null @@ -1,984 +0,0 @@ -{ - "network": "hederatestnet", - "wallet": { - "type": "ENCRYPTED_JSON", - "encryptedJson": "{\"address\":\"1245e5b64d785b25057f7438f715f4aa5d965733\",\"id\":\"bf069d1b-4e88-487c-b695-f2e03ed7c1ff\",\"version\":3,\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"cipherparams\":{\"iv\":\"1f34e7bfdaee4b0778ecea4c8d12a543\"},\"ciphertext\":\"4f6cee88b4776f4f6f8eedf3da11c6a13542aa4bb65d46a5c1bc44c100a96f54\",\"kdf\":\"scrypt\",\"kdfparams\":{\"salt\":\"d931e0ea13032fd70060e40054c5a76c0571f4d840ec91eeda1bf68bdcad84db\",\"n\":1,\"dklen\":32,\"p\":1,\"r\":8},\"mac\":\"06c7897e3ff04245bf4f0765d8b6a8482c1c9981cb46ae88f636f9c83cd0b891\"},\"x-ethers\":{\"client\":\"ethers.js\",\"gethFilename\":\"UTC--2020-05-15T09-03-13.0Z--1245e5b64d785b25057f7438f715f4aa5d965733\",\"mnemonicCounter\":\"99b7f5b6897dcfe22fc7aa00d8e3cf5e\",\"mnemonicCiphertext\":\"6e7c1d38f162e54050b125f1f51b43ca\",\"path\":\"m/44'/60'/0'/0/0\",\"version\":\"0.1\"}}" - }, - "forms": [ - { - "name": "TradeTrust Bill of Lading v2", - "type": "TRANSFERABLE_RECORD", - "defaults": { - "$template": { - "type": "EMBEDDED_RENDERER", - "name": "BILL_OF_LADING", - "url": "https://generic-templates.tradetrust.io" - }, - "issuers": [ - { - "identityProof": { - "type": "DNS-TXT", - "location": "trsutlv.org" - }, - "name": "DEMO TOKEN REGISTRY", - "tokenRegistry": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - } - ] - }, - "schema": { - "type": "object", - "required": ["blNumber", "scac"], - "properties": { - "blNumber": { - "type": "string", - "title": "BL Number" - }, - "scac": { - "type": "string", - "title": "Standard Carrier Alpha Code (SCAC)" - }, - "carrierName": { - "title": "Signed for the Carrier", - "type": "string" - }, - "shipper": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "address": { - "type": "object", - "properties": { - "street": { - "type": "string" - }, - "country": { - "type": "string" - } - } - } - } - }, - "consignee": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "notifyParty": { - "title": "Notify Party", - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "vessel": { - "type": "string" - }, - "voyageNo": { - "title": "Voyage No.", - "type": "string" - }, - "portOfLoading": { - "title": "Port of Loading", - "type": "string" - }, - "portOfDischarge": { - "title": "Port of Discharge", - "type": "string" - }, - "placeOfReceipt": { - "title": "Place of Receipt", - "type": "string" - }, - "placeOfDelivery": { - "title": "Place of Delivery", - "type": "string" - }, - "packages": { - "type": "array", - "title": "Packages", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "measurement": { - "type": "string" - }, - "weight": { - "type": "string" - } - } - } - } - } - }, - "attachments": { - "allow": true, - "accept": ".pdf, .json" - }, - "extension": "tt", - "fileName": "bill-<%= blNumber %>" - }, - { - "name": "TradeTrust CHAFTA Certificate of Origin v2", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "$template": { - "type": "EMBEDDED_RENDERER", - "name": "CHAFTA_COO", - "url": "https://generic-templates.tradetrust.io" - }, - "issuers": [ - { - "identityProof": { - "type": "DNS-TXT", - "location": "trsutlv.org" - }, - "name": "DEMO DOCUMENT STORE", - "documentStore": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - } - ] - }, - "schema": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "COO ID" - }, - "issueDateTime": { - "type": "string", - "title": "Issued Date & Time" - }, - "firstSignatoryAuthentication": { - "title": "Signatory Authentication", - "type": "object", - "properties": { - "signature": { - "type": "string", - "title": "First Signatory" - } - } - }, - "supplyChainConsignment": { - "title": "Supply Chain Consignment", - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "information": { - "type": "string", - "title": "Consignment Information" - }, - "exportCountry": { - "title": "Export Country", - "type": "object", - "properties": { - "code": { - "type": "string", - "title": "Country Code" - } - } - }, - "exporter": { - "title": "Exporter", - "type": "object", - "properties": { - "iD": { - "title": "ID", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal Code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division Name" - }, - "countryCode": { - "type": "string", - "title": "Country Code" - } - } - } - } - }, - "importCountry": { - "type": "object", - "title": "Import Country", - "properties": { - "code": { - "type": "string", - "title": "Country Code" - } - } - }, - "importer": { - "title": "Importer's Details (if known)", - "type": "object", - "properties": { - "iD": { - "title": "Importer ID", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal Code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division Name" - }, - "countryCode": { - "type": "string", - "title": "Country Code" - } - } - } - } - }, - "includedConsignmentItems": { - "type": "array", - "title": "Included Consignment Items", - "items": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "information": { - "type": "string", - "title": "Information" - }, - "crossBorderRegulatoryProcedure": { - "type": "object", - "title": "", - "properties": { - "originCriteriaText": { - "type": "string", - "title": "Origin Criteria Text" - } - } - }, - "manufacturer": { - "type": "object", - "title": "Manufacturer", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "name": { - "type": "string", - "title": "Name" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal Code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division Name" - }, - "countryCode": { - "type": "string", - "title": "Country Code" - } - } - } - } - }, - "tradeLineItems": { - "type": "array", - "title": "Trade line Items", - "items": { - "type": "object", - "properties": { - "sequenceNumber": { - "type": "integer", - "title": "Sequence Number" - }, - "invoiceReference": { - "type": "object", - "title": "Invoice Reference", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "formattedIssueDateTime": { - "type": "string", - "title": "Formatted Issue Date & Time" - }, - "attachedBinaryFile": { - "type": "object", - "title": "", - "properties": { - "uRI": { - "type": "string", - "title": "Attached Binary File URI" - } - } - } - } - }, - "tradeProduct": { - "type": "object", - "title": "Trade Product", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "description": { - "type": "string", - "title": "Description" - }, - "harmonisedTariffCode": { - "type": "object", - "title": "", - "properties": { - "classCode": { - "type": "string", - "title": "Harmonised Tariff Class Code" - }, - "className": { - "type": "string", - "title": "Harmonised Tariff Class Name" - } - } - }, - "originCountry": { - "type": "object", - "title": "Origin Country", - "properties": { - "code": { - "type": "string", - "title": "Code" - } - } - } - } - }, - "transportPackages": { - "type": "array", - "title": "Transport Packages", - "items": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "grossVolume": { - "type": "string", - "title": "Gross Volume" - }, - "grossWeight": { - "type": "string", - "title": "Gross Weight" - } - } - } - } - } - } - } - } - } - }, - "loadingBaseportLocation": { - "type": "object", - "title": "Loading Baseport Location", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "name": { - "type": "string", - "title": "Name" - } - } - }, - "mainCarriageTransportMovement": { - "title": "Main Carriage Transport Movement", - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "information": { - "type": "string", - "title": "Information" - }, - "usedTransportMeans": { - "title": "", - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Used Transport" - }, - "iD": { - "type": "string", - "title": "Used Transport ID" - } - } - }, - "departureEvent": { - "title": "", - "type": "object", - "properties": { - "departureDateTime": { - "type": "string", - "title": "Departure Date and Time" - } - } - } - } - }, - "unloadingBaseportLocation": { - "type": "object", - "title": "Unloading Baseport Location", - "properties": { - "iD": { - "type": "string", - "title": "ID" - }, - "name": { - "type": "string", - "title": "Name" - } - } - } - } - } - } - }, - "uiSchema": { - "firstSignatoryAuthentication": { - "signature": { - "ui:widget": "file", - "ui:options": { - "text": "Upload Signature", - "accept": ".png, .jpeg, .jpg" - } - } - }, - "issueDateTime": { - "ui:widget": "datetime" - }, - "supplyChainConsignment": { - "mainCarriageTransportMovement": { - "departureEvent": { - "departureDateTime": { - "ui:widget": "datetime" - } - } - } - } - }, - "attachments": { - "allow": true, - "accept": ".pdf" - }, - "extension": "tt" - }, - { - "name": "TradeTrust Simple Certificate of Origin v2", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "$template": { - "type": "EMBEDDED_RENDERER", - "name": "SIMPLE_COO", - "url": "https://generic-templates.tradetrust.io" - }, - "issuers": [ - { - "identityProof": { - "type": "DNS-TXT", - "location": "trsutlv.org" - }, - "name": "DEMO DOCUMENT STORE", - "documentStore": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - } - ] - }, - "schema": { - "type": "object", - "required": ["documentName"], - "properties": { - "documentName": { - "type": "string", - "title": "Document Name" - }, - "cooId": { - "type": "string", - "title": "COO ID" - }, - "issueIn": { - "type": "string", - "title": "Issued In" - }, - "issueDateAndTime": { - "type": "string", - "title": "Issued Date & Time" - }, - "exporterDetails": { - "title": "Exporter Details", - "type": "object", - "properties": { - "exportCountry": { - "type": "string", - "title": "Export Country" - }, - "exporterName": { - "type": "string", - "title": "Exporter Name" - }, - "exporterAddress": { - "title": "Exporter Address", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - } - } - } - } - }, - "importerDetails": { - "title": "Importer Details", - "type": "object", - "properties": { - "importCountry": { - "type": "string", - "title": "Import Country" - }, - "importerName": { - "type": "string", - "title": "Importer Name" - }, - "importerAddress": { - "title": "Importer Address", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - } - } - } - } - }, - "descriptionOfGoods": { - "type": "object", - "title": "Description of Goods", - "properties": { - "includedConsignments": { - "type": "string", - "title": "Included Consignments" - }, - "importerNameMarksAndNumber": { - "type": "string", - "title": "Importer Name, Marks & Number" - }, - "numberAndKindOfPackage": { - "type": "string", - "title": "Number & Kind of Package" - }, - "hsCode": { - "type": "string", - "title": "Harmonised System (HS) Code" - }, - "invoiceNumber": { - "type": "string", - "title": "Invoice Number" - }, - "dateOfInvoice": { - "type": "string", - "title": "Date of Invoice" - }, - "loadingBaseportLocationName": { - "type": "string", - "title": "Loading Baseport Location Name" - }, - "mainCarriageTransportMovementId": { - "type": "string", - "title": "Main Carriage Transport Movement ID" - } - } - }, - "firstSignatoryAuthentication": { - "title": "Signatory Authentication", - "type": "object", - "properties": { - "signature": { - "type": "string", - "title": "First Signatory" - }, - "actualDate": { - "type": "string", - "title": "Date" - }, - "statement": { - "type": "string", - "title": "Statement" - } - } - } - } - }, - "uiSchema": { - "firstSignatoryAuthentication": { - "signature": { - "ui:widget": "file", - "ui:options": { - "text": "Upload Signature", - "accept": ".png, .jpeg, .jpg" - } - }, - "actualDate": { - "ui:widget": "date" - } - }, - "descriptionOfGoods": { - "dateOfInvoice": { - "ui:widget": "date" - } - } - }, - "extension": "tt" - }, - { - "name": "TradeTrust Covering Letter v2", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "$template": { - "type": "EMBEDDED_RENDERER", - "name": "COVERING_LETTER", - "url": "https://generic-templates.tradetrust.io" - }, - "issuers": [ - { - "identityProof": { - "type": "DNS-TXT", - "location": "trustlv.org" - }, - "name": "DEMO DOCUMENT STORE", - "documentStore": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - } - ] - }, - "schema": { - "type": "object", - "properties": { - "logo": { - "type": "string", - "title": "Document Title" - }, - "title": { - "type": "string", - "title": "Document Title" - }, - "remarks": { - "type": "string", - "title": "Remarks" - }, - "backgroundColor": { - "type": "string", - "title": "Background Color" - }, - "titleColor": { - "type": "string", - "title": "Title Color" - }, - "remarksColor": { - "type": "string", - "title": "Remarks Color" - } - } - }, - "attachments": { - "allow": true - }, - "uiSchema": { - "logo": { - "ui:widget": "file", - "ui:options": { - "text": "Upload Cover Letter Logo", - "accept": ".png, .jpeg, .jpg" - } - }, - "remarks": { - "ui:widget": "textarea" - }, - "backgroundColor": { - "ui:widget": "color", - "ui:options": { - "emptyValue": "#ffffff" - } - }, - "titleColor": { - "ui:widget": "color", - "ui:options": { - "emptyValue": "#4e4e50" - } - }, - "remarksColor": { - "ui:widget": "color", - "ui:options": { - "emptyValue": "#4e4e50" - } - } - }, - "extension": "tt" - }, - { - "name": "TradeTrust Invoice v2", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "$template": { - "type": "EMBEDDED_RENDERER", - "name": "INVOICE", - "url": "https://generic-templates.tradetrust.io" - }, - "issuers": [ - { - "identityProof": { - "type": "DNS-TXT", - "location": "trustlv.org" - }, - "name": "DEMO DOCUMENT STORE", - "documentStore": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - } - ] - }, - "schema": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "Invoice ID" - }, - "date": { - "type": "string", - "title": "Date" - }, - "customerId": { - "type": "string", - "title": "Customer ID" - }, - "terms": { - "type": "string", - "title": "Terms" - }, - "billFrom": { - "type": "object", - "title": "Bill From", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "streetAddress": { - "type": "string", - "title": "Street Address" - }, - "city": { - "type": "string", - "title": "City" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - }, - "phoneNumber": { - "type": "string", - "title": "Phone Number" - } - } - }, - "billTo": { - "type": "object", - "title": "Bill To", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "email": { - "type": "string", - "title": "Email" - }, - "company": { - "type": "object", - "title": "Bill To Company", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "streetAddress": { - "type": "string", - "title": "Street Address" - }, - "city": { - "type": "string", - "title": "City" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - }, - "phoneNumber": { - "type": "string", - "title": "Phone Number" - } - } - } - } - }, - "billableItems": { - "type": "array", - "title": "Billable Items", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string", - "title": "Description" - }, - "quantity": { - "type": "string", - "title": "Quantity" - }, - "unitPrice": { - "type": "string", - "title": "Unit Price" - }, - "amount": { - "type": "string", - "title": "Amount" - } - } - } - }, - "subtotal": { - "type": "string", - "title": "Subtotal" - }, - "tax": { - "type": "string", - "title": "Tax (%)" - }, - "taxTotal": { - "type": "string", - "title": "Tax Total" - }, - "total": { - "type": "string", - "title": "Total" - } - } - }, - "uiSchema": { - "date": { - "ui:widget": "date" - } - }, - "extension": "tt" - } - ], - "documentStorage": { - "apiKey": "randomKey", - "url": "https://api.example.com/storage" - } -} diff --git a/src/test/fixtures/config/v3/sample-config-hederatestnet.json b/src/test/fixtures/config/v3/sample-config-hederatestnet.json deleted file mode 100644 index bfa2a2e7..00000000 --- a/src/test/fixtures/config/v3/sample-config-hederatestnet.json +++ /dev/null @@ -1,773 +0,0 @@ -{ - "network": "hederatestnet", - "wallet": { - "type": "ENCRYPTED_JSON", - "encryptedJson": "{\"address\":\"e0a71284ef59483795053266cb796b65e48b5124\",\"id\":\"04c746c3-fbef-453a-8c63-5e915021f57a\",\"version\":3,\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"cipherparams\":{\"iv\":\"0f6963939595d04cb27a4d4abe689e32\"},\"ciphertext\":\"c80c8ca9acb96cf2f87279fef71508a06d4cf166e46e06a8beecd1420f2f525f\",\"kdf\":\"scrypt\",\"kdfparams\":{\"salt\":\"bf52c3386a9235e74a075c533ec1febd6e9221b57d649a2e156775fce984a58e\",\"n\":1,\"dklen\":32,\"p\":1,\"r\":8},\"mac\":\"5014d1d53e9294028eb808fbc9dd36394ebec22381946724111b9ee5ab46fd06\"}}" - }, - "forms": [ - { - "name": "TradeTrust Bill of Lading v3", - "type": "TRANSFERABLE_RECORD", - "defaults": { - "version": "https://schema.openattestation.com/3.0/schema.json", - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schemata.openattestation.com/com/openattestation/1.0/OpenAttestation.v3.json", - "https://schemata.openattestation.com/io/tradetrust/bill-of-lading/1.0/bill-of-lading-context.json" - ], - "type": ["VerifiableCredential", "OpenAttestationCredential"], - "issuanceDate": "2010-01-01T19:23:24Z", - "openAttestationMetadata": { - "template": { - "type": "EMBEDDED_RENDERER", - "name": "BILL_OF_LADING", - "url": "https://generic-templates.tradetrust.io" - }, - "proof": { - "type": "OpenAttestationProofMethod", - "method": "TOKEN_REGISTRY", - "value": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - }, - "identityProof": { - "type": "DNS-TXT", - "identifier": "trustlv.org" - } - }, - "credentialSubject": {}, - "issuer": { - "id": "https://example.com", - "name": "DEMO TOKEN REGISTRY", - "type": "OpenAttestationIssuer" - } - }, - "schema": { - "type": "object", - "properties": { - "credentialSubject": { - "type": "object", - "required": ["blNumber", "scac"], - "properties": { - "blNumber": { - "type": "string", - "title": "BL Number" - }, - "scac": { - "type": "string", - "title": "Standard Carrier Alpha Code (SCAC)" - }, - "carrierName": { - "title": "Signed for the Carrier", - "type": "string" - }, - "shipper": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "address": { - "type": "object", - "properties": { - "street": { - "type": "string" - }, - "country": { - "type": "string" - } - } - } - } - }, - "consignee": { - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "notifyParty": { - "title": "Notify Party", - "type": "object", - "properties": { - "name": { - "type": "string" - } - } - }, - "vessel": { - "type": "string" - }, - "voyageNo": { - "title": "Voyage No.", - "type": "string" - }, - "portOfLoading": { - "title": "Port of Loading", - "type": "string" - }, - "portOfDischarge": { - "title": "Port of Discharge", - "type": "string" - }, - "placeOfReceipt": { - "title": "Place of Receipt", - "type": "string" - }, - "placeOfDelivery": { - "title": "Place of Delivery", - "type": "string" - }, - "packages": { - "type": "array", - "title": "Packages", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "measurement": { - "type": "string" - }, - "weight": { - "type": "string" - } - } - } - } - } - } - } - } - }, - { - "name": "TradeTrust ChAFTA Certificate of Origin v3", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "version": "https://schema.openattestation.com/3.0/schema.json", - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schemata.openattestation.com/io/tradetrust/certificate-of-origin/1.0/certificate-of-origin-context.json", - "https://schemata.openattestation.com/com/openattestation/1.0/OpenAttestation.v3.json" - ], - "type": ["VerifiableCredential", "OpenAttestationCredential"], - "issuanceDate": "2010-01-01T19:23:24Z", - "openAttestationMetadata": { - "template": { - "type": "EMBEDDED_RENDERER", - "name": "CHAFTA_COO", - "url": "https://generic-templates.tradetrust.io" - }, - "proof": { - "type": "OpenAttestationProofMethod", - "method": "DOCUMENT_STORE", - "value": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - }, - "identityProof": { - "type": "DNS-TXT", - "identifier": "trustlv.org" - } - }, - "credentialSubject": {}, - "issuer": { - "id": "https://example.com", - "name": "DEMO DOCUMENT STORE", - "type": "OpenAttestationIssuer" - } - }, - "schema": { - "type": "object", - "properties": { - "credentialSubject": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "COO ID" - }, - "issueDateTime": { - "type": "string", - "title": "Issued Date & Time" - }, - "firstSignatoryAuthentication": { - "title": "Signatory Authentication", - "type": "object", - "properties": { - "signature": { - "type": "string", - "title": "First Signatory" - }, - "actualDateTime": { - "type": "string", - "title": "Actual Date Time" - } - } - }, - "supplyChainConsignment": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "information": { - "type": "string", - "title": "Consignment Information" - }, - "exportCountry": { - "title": "Export country", - "type": "object", - "properties": { - "code": { - "type": "string", - "title": "Country code" - } - } - }, - "exporter": { - "title": "Exporter", - "type": "object", - "properties": { - "iD": { - "title": "iD", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division name" - }, - "countryCode": { - "type": "string", - "title": "Country code" - } - } - } - } - }, - "importCountry": { - "type": "object", - "title": "Import country", - "properties": { - "code": { - "type": "string", - "title": "Country code" - } - } - }, - "importer": { - "title": "Importer's Details (if known)", - "type": "object", - "properties": { - "iD": { - "title": "importer iD", - "type": "string" - }, - "name": { - "title": "Name", - "type": "string" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division name" - }, - "countryCode": { - "type": "string", - "title": "Country code" - } - } - } - } - }, - "includedConsignmentItems": { - "type": "array", - "title": "Included Consignment Items", - "items": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "information": { - "type": "string", - "title": "Information" - }, - "crossBorderRegulatoryProcedure": { - "type": "object", - "title": "", - "properties": { - "originCriteriaText": { - "type": "string", - "title": "Origin criteria text" - } - } - }, - "manufacturer": { - "type": "object", - "title": "Manufacturer", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "name": { - "type": "string", - "title": "Name" - }, - "postalAddress": { - "title": "", - "type": "object", - "properties": { - "line1": { - "type": "string", - "title": "Address Line 1" - }, - "line2": { - "type": "string", - "title": "Address Line 2" - }, - "cityName": { - "type": "string", - "title": "City" - }, - "postcode": { - "type": "string", - "title": "Postal code" - }, - "countrySubDivisionName": { - "type": "string", - "title": "Country Sub Division name" - }, - "countryCode": { - "type": "string", - "title": "Country code" - } - } - } - } - }, - "tradeLineItems": { - "type": "array", - "title": "Trade line Items", - "items": { - "type": "object", - "properties": { - "sequenceNumber": { - "type": "integer", - "title": "Sequence Number" - }, - "invoiceReference": { - "type": "object", - "title": "Invoice reference", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "formattedIssueDateTime": { - "type": "string", - "title": "Formatted issue date & time" - }, - "attachedBinaryFile": { - "type": "object", - "title": "", - "properties": { - "uRI": { - "type": "string", - "title": "Attached binary file uRI" - } - } - } - } - }, - "tradeProduct": { - "type": "object", - "title": "Trade product", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "description": { - "type": "string", - "title": "Description" - }, - "harmonisedTariffCode": { - "type": "object", - "title": "", - "properties": { - "classCode": { - "type": "string", - "title": "Harmonised tariff class code" - }, - "className": { - "type": "string", - "title": "Harmonised tariff class name" - } - } - }, - "originCountry": { - "type": "object", - "title": "Origin country", - "properties": { - "code": { - "type": "string", - "title": "Code" - } - } - } - } - }, - "transportPackages": { - "type": "array", - "title": "Transport packages", - "items": { - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "grossVolume": { - "type": "string", - "title": "Gross volume" - }, - "grossWeight": { - "type": "string", - "title": "Gross weight" - } - } - } - } - } - } - } - } - } - }, - "loadingBaseportLocation": { - "type": "object", - "title": "Loading Baseport Location", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "name": { - "type": "string", - "title": "Name" - } - } - }, - "mainCarriageTransportMovement": { - "title": "Main Carraige Transport Movement", - "type": "object", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "information": { - "type": "string", - "title": "Information" - }, - "usedTransportMeans": { - "title": "", - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "Used transport" - }, - "iD": { - "type": "string", - "title": "Used transport iD" - } - } - }, - "departureEvent": { - "title": "", - "type": "object", - "properties": { - "departureDateTime": { - "type": "string", - "title": "Departure date and time" - } - } - } - } - }, - "unloadingBaseportLocation": { - "type": "object", - "title": "Unloading Baseport Location", - "properties": { - "iD": { - "type": "string", - "title": "iD" - }, - "name": { - "type": "string", - "title": "Name" - } - } - } - } - } - } - } - } - }, - "uiSchema": { - "credentialSubject": { - "firstSignatoryAuthentication": { - "signature": { - "ui:widget": "file", - "ui:options": { - "text": "Upload Signature", - "accept": ".png, .jpeg, .jpg" - } - }, - "actualDateTime": { - "ui:widget": "datetime" - } - }, - "issueDateTime": { - "ui:widget": "datetime" - }, - "supplyChainConsignment": { - "mainCarriageTransportMovement": { - "departureEvent": { - "departureDateTime": { - "ui:widget": "datetime" - } - } - } - } - } - }, - "attachments": { - "allow": true, - "accept": ".pdf" - }, - "extension": "tt" - }, - { - "name": "TradeTrust Invoice v3", - "type": "VERIFIABLE_DOCUMENT", - "defaults": { - "version": "https://schema.openattestation.com/3.0/schema.json", - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schemata.openattestation.com/io/tradetrust/Invoice/1.0/invoice-context.json", - "https://schemata.openattestation.com/com/openattestation/1.0/OpenAttestation.v3.json" - ], - "type": ["VerifiableCredential", "OpenAttestationCredential"], - "issuanceDate": "2010-01-01T19:23:24Z", - "openAttestationMetadata": { - "template": { - "type": "EMBEDDED_RENDERER", - "name": "INVOICE", - "url": "https://generic-templates.tradetrust.io" - }, - "proof": { - "type": "OpenAttestationProofMethod", - "method": "DOCUMENT_STORE", - "value": "0x222B69788e2e9B7FB93a3a0fE258D4604Dc7df21" - }, - "identityProof": { - "type": "DNS-TXT", - "identifier": "trustlv.org" - } - }, - "credentialSubject": {}, - "issuer": { - "id": "https://example.com", - "name": "DEMO DOCUMENT STORE", - "type": "OpenAttestationIssuer" - } - }, - "schema": { - "type": "object", - "properties": { - "credentialSubject": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "Invoice ID" - }, - "date": { - "type": "string", - "title": "Date" - }, - "customerId": { - "type": "string", - "title": "Customer ID" - }, - "terms": { - "type": "string", - "title": "Terms" - }, - "billFrom": { - "type": "object", - "title": "Bill From", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "streetAddress": { - "type": "string", - "title": "Street Address" - }, - "city": { - "type": "string", - "title": "City" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - }, - "phoneNumber": { - "type": "string", - "title": "Phone Number" - } - } - }, - "billTo": { - "type": "object", - "title": "Bill To", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "email": { - "type": "string", - "title": "Email" - }, - "company": { - "type": "object", - "title": "Bill To Company", - "properties": { - "name": { - "type": "string", - "title": "Name" - }, - "streetAddress": { - "type": "string", - "title": "Street Address" - }, - "city": { - "type": "string", - "title": "City" - }, - "postalCode": { - "type": "string", - "title": "Postal Code" - }, - "phoneNumber": { - "type": "string", - "title": "Phone Number" - } - } - } - } - }, - "billableItems": { - "type": "array", - "title": "Billable Items", - "items": { - "type": "object", - "properties": { - "description": { - "type": "string", - "title": "Description" - }, - "quantity": { - "type": "string", - "title": "Quantity" - }, - "unitPrice": { - "type": "string", - "title": "Unit Price" - }, - "amount": { - "type": "string", - "title": "Amount" - } - } - } - }, - "subtotal": { - "type": "string", - "title": "Subtotal" - }, - "tax": { - "type": "string", - "title": "Tax (%)" - }, - "taxTotal": { - "type": "string", - "title": "Tax Total" - }, - "total": { - "type": "string", - "title": "Total" - } - } - } - } - } - } - ], - "documentStorage": { - "apiKey": "randomKey", - "url": "https://api.example.com/storage" - } -} diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 2f1755a9..ae9b4e38 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -11,8 +11,6 @@ export type Network = | "amoy" | "xdc" | "xdcapothem" - | "hederamainnet" - | "hederatestnet" | "stabilitytestnet" | "stability" | "astron"; diff --git a/src/utils/utils.test.tsx b/src/utils/utils.test.tsx index b5a1c67d..ab35cfda 100644 --- a/src/utils/utils.test.tsx +++ b/src/utils/utils.test.tsx @@ -12,15 +12,7 @@ describe("generateFileName", () => { expect(fileName).toStrictEqual("document-1-sepolia.tt"); }); - it("should generate the file name correctly with the given config and file name for hederatestnet", async () => { - const fileName = generateFileName({ - network: "hederatestnet", - fileName: "document-1", - extension: "tt", - }); - expect(fileName).toStrictEqual("document-1-hederatestnet.tt"); - }); it("should generate the file name correctly when config.network is 'homestead'", async () => { const fileName = generateFileName({ network: "homestead",