diff --git a/package.json b/package.json index b391b422..de9cd646 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "prettify": "prettier --write \"src/**/*.ts*\" \"src/**/*.css*\"" }, "dependencies": { - "@kiltprotocol/sdk-js": "^0.33.1", + "@kiltprotocol/sdk-js": "^0.34.0", "@polkadot/api": "^10.9.1", "@polkadot/extension-dapp": "^0.46.5", "@polkadot/util-crypto": "^12.4.1", diff --git a/src/Components/CredentialDetails/CredentialDetails.tsx b/src/Components/CredentialDetails/CredentialDetails.tsx index d1e530f3..89d5f85c 100644 --- a/src/Components/CredentialDetails/CredentialDetails.tsx +++ b/src/Components/CredentialDetails/CredentialDetails.tsx @@ -32,10 +32,15 @@ function useChainData(credentialV1: KiltPublishedCredentialV1) { (async () => { try { - const { title } = await CType.fetchFromChain( + const fetched = await CType.fetchFromChain( CType.hashToId(credential.claim.cTypeHash), ); - setLabel(title); + if ('title' in fetched) { + // TODO: remove this `if` once the Spiritnet is updated + setLabel(fetched.title as string); + return; + } + setLabel(fetched.cType.title); } catch { // no error, credential can still be verified } diff --git a/yarn.lock b/yarn.lock index 634c218e..c7634686 100644 --- a/yarn.lock +++ b/yarn.lock @@ -325,69 +325,69 @@ "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@kiltprotocol/asset-did@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/asset-did/-/asset-did-0.33.1.tgz#039dd6f9ca8dc33eec9e639ddbe2c500bb3fa331" - integrity sha512-CsXFAvjTQ/GnGXoJJIPZnt+5sODRqFRWMXstoZrGgu9Tw/3uYRV54sitDpCwvlFzEnF3R11zFKGdB1DMfzlSOA== +"@kiltprotocol/asset-did@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/asset-did/-/asset-did-0.34.0.tgz#574ae07289eac2654b883500e460834664769dca" + integrity sha512-oY2uGj+QnzkUHzFNR/qil6qD1LH+YNw5Bgp4B/1XYpSeOiNrmrlDj8MGScBm+R7bhvNGAWH0+aOtnSlSyEeNaw== dependencies: - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" -"@kiltprotocol/augment-api@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/augment-api/-/augment-api-0.33.1.tgz#85d91d27ea26b5b0a7671ff69a8e60222bb3eda1" - integrity sha512-j2+A29O3DenX4fn43s4JwvmpaL6l3YJJMY+n7AMAJNvbHpWZljzONMwIr/9OfX5UoeE9VCQL1ISQ1Ibf+/UFrQ== +"@kiltprotocol/augment-api@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/augment-api/-/augment-api-0.34.0.tgz#08f6a183ebc3cc79d045e5c441da0b8ef5602775" + integrity sha512-0dLLShwFLmc95L8yGKWHvZ6X/EooVJfOLmb8mL/ioG8mwEjmDz9g1FC0eAUcPtJfjVaHTuRYJUcV8w04BuhU+g== dependencies: - "@kiltprotocol/type-definitions" "0.33.1" + "@kiltprotocol/type-definitions" "0.34.0" -"@kiltprotocol/chain-helpers@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/chain-helpers/-/chain-helpers-0.33.1.tgz#d8621dd035fc9b1a0c26e748019038135123ac75" - integrity sha512-kHvHgIJmkrG1sO2xB2C+I7rQGrKlZdjSR7ukJXxw3K/33zjKZN49TOar7gcTpE4iaDJ3NERTVwHd6d6GRGLJmw== +"@kiltprotocol/chain-helpers@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/chain-helpers/-/chain-helpers-0.34.0.tgz#a12cbb24aad1a867012e61af08957048a4138737" + integrity sha512-rky1q9bIKgVYCOA6HcVaJJapU8EWuHPqXqDxGnUcKAFwVu8MMQ44MSvgqv6+JGvmMcGwe7m57lPGKpEhSYFr6w== dependencies: - "@kiltprotocol/config" "0.33.1" - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" + "@kiltprotocol/config" "0.34.0" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" "@polkadot/api" "^10.4.0" "@polkadot/types" "^10.4.0" -"@kiltprotocol/config@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/config/-/config-0.33.1.tgz#2fd8d2cd3b5eb40c50bd76b7d130c4566ea580fe" - integrity sha512-12pOdI9qbOPiF3TNNtMjeEVb+cMW84KKttXsULYFW+/wvKV2pquL0Fx5SOMEC/a2mBA8uHGYRWnN46HxN9VQhw== +"@kiltprotocol/config@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/config/-/config-0.34.0.tgz#7ceeaec5c51989ee88d7dd89bc35f9a82f01fff4" + integrity sha512-eAupi3kWksWkbsphPGRo75Q8uAIlmHJWo/LDxUotuQyuo2tlo+TTLaBGzBgoF4P/6ItVPI+c5c4ie/686+PhSw== dependencies: - "@kiltprotocol/types" "0.33.1" + "@kiltprotocol/types" "0.34.0" "@polkadot/api" "^10.4.0" typescript-logging "^1.0.0" -"@kiltprotocol/core@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/core/-/core-0.33.1.tgz#946535a125940e303359d60a084d4a067e029f0f" - integrity sha512-ESgopzxQBYThx0MOXOYNDX0wU/4smbATmhD9GSoMLx5r8hJ4w3s00Mip8QUb36l7VpVsiiQO6zqawIc857ksNw== - dependencies: - "@kiltprotocol/asset-did" "0.33.1" - "@kiltprotocol/augment-api" "0.33.1" - "@kiltprotocol/chain-helpers" "0.33.1" - "@kiltprotocol/config" "0.33.1" - "@kiltprotocol/did" "0.33.1" - "@kiltprotocol/type-definitions" "0.33.1" - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" +"@kiltprotocol/core@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/core/-/core-0.34.0.tgz#574f35da0b7a5d1ae14fc97fd81702ae39e6d861" + integrity sha512-yAdHdljHupwuFFV6Qq0IUxQAe3VtdqcjOe/D7whMOQBRcoSLJ8ffb2Wu+RuPQXaGFTCF0d0KUurfFmOSsq14Yg== + dependencies: + "@kiltprotocol/asset-did" "0.34.0" + "@kiltprotocol/augment-api" "0.34.0" + "@kiltprotocol/chain-helpers" "0.34.0" + "@kiltprotocol/config" "0.34.0" + "@kiltprotocol/did" "0.34.0" + "@kiltprotocol/type-definitions" "0.34.0" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" "@polkadot/api" "^10.4.0" "@polkadot/keyring" "^12.0.0" "@polkadot/types" "^10.4.0" "@polkadot/util" "^12.0.0" "@polkadot/util-crypto" "^12.0.0" -"@kiltprotocol/did@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/did/-/did-0.33.1.tgz#8a0cdcff183af31b3a5e6c2655bb389da9f89e15" - integrity sha512-zAIviziNkQ6lF+GRC9hewlS0Lo/Q81G+z2+L4tl3Ku02kvbVwHatopzE8G0T+lLlFyebN526Alg2Pty5Mk2rQA== +"@kiltprotocol/did@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/did/-/did-0.34.0.tgz#da523df2eb5ec15231e042883c369ae0183094e4" + integrity sha512-i+E+BLRAYQ1qBysx3dK5WhagZHYrtxI6b79B+qoAo73LJJhHrk0te4mzrmNkPB8VAWFABuy/oXhZ1v7JqA02bQ== dependencies: - "@kiltprotocol/augment-api" "0.33.1" - "@kiltprotocol/config" "0.33.1" - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" + "@kiltprotocol/augment-api" "0.34.0" + "@kiltprotocol/config" "0.34.0" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" "@polkadot/api" "^10.4.0" "@polkadot/keyring" "^12.0.0" "@polkadot/types" "^10.4.0" @@ -395,39 +395,39 @@ "@polkadot/util" "^12.0.0" "@polkadot/util-crypto" "^12.0.0" -"@kiltprotocol/messaging@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/messaging/-/messaging-0.33.1.tgz#a1eb8664ce6c898ead281f92accab4f7a2669922" - integrity sha512-qLH4uNAY7p46B5Afl0vmXRlm7V6AzTcMxNfoCV7pivvhY8wcbXVbiSh0JVVSHd2m4bzA1bWnloz07Vek3rHYmA== +"@kiltprotocol/messaging@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/messaging/-/messaging-0.34.0.tgz#cf6296adb14169fe74ad77a548501a6f79c38215" + integrity sha512-SGguJfEtO7/HTTMQj+Qhzv//R6e5VbtNdY8qfkbiRhncA4yGwbiqrBHkQzLorAc/911AYlBWvLkhAjrk6hC1yg== dependencies: - "@kiltprotocol/core" "0.33.1" - "@kiltprotocol/did" "0.33.1" - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" + "@kiltprotocol/core" "0.34.0" + "@kiltprotocol/did" "0.34.0" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" "@polkadot/util" "^12.0.0" -"@kiltprotocol/sdk-js@^0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/sdk-js/-/sdk-js-0.33.1.tgz#af54068ca5f82423242b0994fb42e9586da68490" - integrity sha512-AoqFINPQ2PFAEtHBDhBTW0/qsaRBI50RhHHXb+ntFtpHxh2+CrEzKo3p2WAfe+XF9hFO3AjABcZ/4MFgyHAj2Q== - dependencies: - "@kiltprotocol/chain-helpers" "0.33.1" - "@kiltprotocol/config" "0.33.1" - "@kiltprotocol/core" "0.33.1" - "@kiltprotocol/did" "0.33.1" - "@kiltprotocol/messaging" "0.33.1" - "@kiltprotocol/types" "0.33.1" - "@kiltprotocol/utils" "0.33.1" - -"@kiltprotocol/type-definitions@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/type-definitions/-/type-definitions-0.33.1.tgz#d9b908cc613e6dfabdc0eeb6a1cd3f9313158c01" - integrity sha512-pQfpzrizMmIbVeDEeCjLzYtusP2laUSoXkfvAQNs3qJPqqn99mlRdGd6sAD/rSEOpGjAl7BlV4dpxqFKkrd7Fg== - -"@kiltprotocol/types@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/types/-/types-0.33.1.tgz#ee4cedfb928cc23756eeee4e0ebe3ba8d53d05c7" - integrity sha512-7iuMz4XNFlRrsGLPxWO0oad+vBZjmntuvf8zoD2LlAnBeHkM8mJ6PUmUQgNmX21DKqvosMsSlLE3nEChf60Q9Q== +"@kiltprotocol/sdk-js@^0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/sdk-js/-/sdk-js-0.34.0.tgz#b4fb588af020b0c450d1d19dc21f5e47d055cf2a" + integrity sha512-FCyN2+byCSA1UMd7n7Y86Vcr6rBi0Ficny5iXmHvKSyR8edV3ptDzUEP2JJUsJ6dQZtj7JKNZ4VXrKywKw0KAA== + dependencies: + "@kiltprotocol/chain-helpers" "0.34.0" + "@kiltprotocol/config" "0.34.0" + "@kiltprotocol/core" "0.34.0" + "@kiltprotocol/did" "0.34.0" + "@kiltprotocol/messaging" "0.34.0" + "@kiltprotocol/types" "0.34.0" + "@kiltprotocol/utils" "0.34.0" + +"@kiltprotocol/type-definitions@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/type-definitions/-/type-definitions-0.34.0.tgz#101c67c84c553b6339545532a28d8af76645205d" + integrity sha512-LMQ7HtIq8n/M/G9sg77xGJVJFVXCA/9w+PWMTK+TGR3KvbM9qmQSnhIPJ2KOU4WFe+62HlJ0V1sOoTZDFr7QNw== + +"@kiltprotocol/types@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/types/-/types-0.34.0.tgz#0c347c5e84bd8216ed0fc1dd677580c05b79042b" + integrity sha512-tbxWr5Z7j29O1zgmqmrAxJEKGUrDEBdQPsFiYuQw7KyJCJjd0TPb+gqg8fHzjTSm+oJCffVLAU/KGAds1vLqZA== dependencies: "@polkadot/api" "^10.4.0" "@polkadot/keyring" "^12.0.0" @@ -435,17 +435,17 @@ "@polkadot/util" "^12.0.0" "@polkadot/util-crypto" "^12.0.0" -"@kiltprotocol/utils@0.33.1": - version "0.33.1" - resolved "https://registry.yarnpkg.com/@kiltprotocol/utils/-/utils-0.33.1.tgz#d912f19323ee80e6aa654172509d8b2322edccbf" - integrity sha512-hSEWxclIiEL0llEAds2+hTEFPzHLRY5WgfXFDJgPT4KPAh+ogWDwQHW0NWgcVb5MTTeb9g03GcqOM1++Dt3H3g== +"@kiltprotocol/utils@0.34.0": + version "0.34.0" + resolved "https://registry.yarnpkg.com/@kiltprotocol/utils/-/utils-0.34.0.tgz#49eb62d8cbfdf0502e00c32dc7c74e93e068d69b" + integrity sha512-FzIoRSElxTXBaHF8706+tnye0iFvs0t/7A3XMDJ59ssLfjTZFhB0cANY6Zr/vR+PCdl00XWxKJ7iZJlAtFDy9w== dependencies: - "@kiltprotocol/types" "0.33.1" + "@kiltprotocol/types" "0.34.0" "@polkadot/api" "^10.4.0" "@polkadot/keyring" "^12.0.0" "@polkadot/util" "^12.0.0" "@polkadot/util-crypto" "^12.0.0" - cbor-web "^8.0.0" + cbor-web "^9.0.0" tweetnacl "^1.0.3" uuid "^9.0.0" @@ -2198,10 +2198,10 @@ caniuse-lite@^1.0.30001370: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001393.tgz#1aa161e24fe6af2e2ccda000fc2b94be0b0db356" integrity sha512-N/od11RX+Gsk+1qY/jbPa0R6zJupEa0lxeBG598EbrtblxVCTJsQwbRBm6+V+rxpc5lHKdsXb9RY83cZIPLseA== -cbor-web@^8.0.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/cbor-web/-/cbor-web-8.1.0.tgz#c1148e91ca6bfc0f5c07c1df164854596e2e33d6" - integrity sha512-2hWHHMVrfffgoEmsAUh8vCxHoLa1vgodtC73+C5cSarkJlwTapnqAzcHINlP6Ej0DXuP4OmmJ9LF+JaNM5Lj/g== +cbor-web@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/cbor-web/-/cbor-web-9.0.1.tgz#844fc2b816939bada26854de60503efd02b15e65" + integrity sha512-9lW24Q2fOvCei/qMSeH48VWOcndR6u/gsi1zqXzXqeTj67XVGR253S+rOaJY+zE9TDahorcpXKeIBFRv4U2MYA== chalk@^1.1.3: version "1.1.3"