From 500967bb219ded1fa1b22071774316286fda31c6 Mon Sep 17 00:00:00 2001 From: huianyang Date: Wed, 11 Sep 2024 16:41:35 -0700 Subject: [PATCH] feat: revive wc2 live code example --- apps/taquito-test-dapp/package.json | 2 + docs/wallet_connect_2.md | 10 +- package-lock.json | 58 ++++-- .../taquito-wallet-connect-2/package.json | 6 +- website/package-lock.json | 183 +++++++++++++----- website/package.json | 2 + website/sidebars.js | 1 + website/src/theme/CodeBlock/index.js | 7 + website/src/theme/Playground/index.js | 4 + 9 files changed, 192 insertions(+), 81 deletions(-) diff --git a/apps/taquito-test-dapp/package.json b/apps/taquito-test-dapp/package.json index b0d99f5977..c73e7aa23c 100644 --- a/apps/taquito-test-dapp/package.json +++ b/apps/taquito-test-dapp/package.json @@ -30,7 +30,9 @@ "@taquito/core": "^20.0.1", "@taquito/taquito": "^20.0.1", "@taquito/utils": "^20.0.1", + "@taquito/wallet-connect-2": "^20.0.1", "buffer": "^6.0.3", + "svelte-modals": "^2.0.0-beta.2", "svelte-select": "^5.8.3", "vite-compatible-readable-stream": "^3.6.1" }, diff --git a/docs/wallet_connect_2.md b/docs/wallet_connect_2.md index 359305e9e7..ad5dfd8ceb 100644 --- a/docs/wallet_connect_2.md +++ b/docs/wallet_connect_2.md @@ -36,7 +36,7 @@ await walletConnect.requestPermissions({ PermissionScopeMethods.OPERATION_REQUEST, PermissionScopeMethods.SIGN ], }, - registryUrl: "https://www.tezos.help/wcdata/" + // registryUrl: "https://www.tezos.help/wcdata/" }); ``` @@ -80,7 +80,7 @@ WalletConnect2.init({ networks: [NetworkType.GHOSTNET], methods: [PermissionScopeMethods.OPERATION_REQUEST], }, - registryUrl: 'https://www.tezos.help/wcdata/', + // registryUrl: 'https://www.tezos.help/wcdata/', }) .then(() => { Tezos.setWalletProvider(walletConnect); @@ -88,13 +88,13 @@ WalletConnect2.init({ .transfer({ to: 'tz1h3rQ8wBxFd8L9B3d7Jhaawu6Z568XU3xY', amount: 1 }) .send() .then((op) => { - println(`Waiting for ${op.opHash} to be confirmed...`); + console.log(`Waiting for ${op.opHash} to be confirmed...`); return op.confirmation().then(() => op.opHash); }) - .then((hash) => println(`https://ghostnet.tzkt.io/${hash}`)); + .then((hash) => console.log(`https://ghostnet.tzkt.io/${hash}`)); }); }) - .catch((err) => println(err)); + .catch((err) => console.log(err)); ``` ## Sign payload with `WalletConnect2` diff --git a/package-lock.json b/package-lock.json index cf02ae9a2f..83a39dd4ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,7 +64,9 @@ "@taquito/core": "^20.0.1", "@taquito/taquito": "^20.0.1", "@taquito/utils": "^20.0.1", + "@taquito/wallet-connect-2": "^20.0.1", "buffer": "^6.0.3", + "svelte-modals": "^2.0.0-beta.2", "svelte-select": "^5.8.3", "vite-compatible-readable-stream": "^3.6.1" }, @@ -20758,6 +20760,12 @@ "svelte": "^3.19.0 || ^4.0.0" } }, + "node_modules/svelte-modals": { + "version": "2.0.0-beta.2", + "resolved": "https://registry.npmjs.org/svelte-modals/-/svelte-modals-2.0.0-beta.2.tgz", + "integrity": "sha512-8crHKCoxKF/oWVf6CY9xpNuRtaZ5+gjsTiotmhB+5S55ClRw2rUQZPmpZJr2NSQnLS8GNK/aiRD4X+otmMu1NQ==", + "license": "MIT" + }, "node_modules/svelte-preprocess": { "version": "6.0.2", "dev": true, @@ -23634,9 +23642,9 @@ "dependencies": { "@taquito/taquito": "^20.0.1", "@walletconnect/legacy-modal": "^2.0.0", - "@walletconnect/sign-client": "^2.15.2", - "@walletconnect/types": "^2.15.2", - "@walletconnect/utils": "^2.15.2" + "@walletconnect/sign-client": "^2.16.1", + "@walletconnect/types": "^2.16.1", + "@walletconnect/utils": "^2.16.1" }, "devDependencies": { "@types/bluebird": "^3.5.42", @@ -23683,9 +23691,10 @@ } }, "packages/taquito-wallet-connect-2/node_modules/@walletconnect/core": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.15.2.tgz", - "integrity": "sha512-u4BGuazSNAQ48QBY7EphanBuBN6EJWyD5MXi83n1wXwfPQWAu0XNvmOjjF+xmMI5TsYH9N6Y78O6HP/VX9EOvg==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.16.1.tgz", + "integrity": "sha512-UlsnEMT5wwFvmxEjX8s4oju7R3zadxNbZgsFeHEsjh7uknY2zgmUe1Lfc5XU6zyPb1Jx7Nqpdx1KN485ee8ogw==", + "license": "Apache-2.0", "dependencies": { "@walletconnect/heartbeat": "1.2.2", "@walletconnect/jsonrpc-provider": "1.0.14", @@ -23698,8 +23707,8 @@ "@walletconnect/relay-auth": "1.0.4", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.15.2", - "@walletconnect/utils": "2.15.2", + "@walletconnect/types": "2.16.1", + "@walletconnect/utils": "2.16.1", "events": "3.3.0", "lodash.isequal": "4.5.0", "uint8arrays": "3.1.0" @@ -23712,6 +23721,7 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/@walletconnect/heartbeat/-/heartbeat-1.2.2.tgz", "integrity": "sha512-uASiRmC5MwhuRuf05vq4AT48Pq8RMi876zV8rr8cV969uTOzWdB/k+Lj5yI2PBtB1bGQisGen7MM1GcZlQTBXw==", + "license": "MIT", "dependencies": { "@walletconnect/events": "^1.0.1", "@walletconnect/time": "^1.0.2", @@ -23722,6 +23732,7 @@ "version": "1.0.14", "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-provider/-/jsonrpc-provider-1.0.14.tgz", "integrity": "sha512-rtsNY1XqHvWj0EtITNeuf8PHMvlCLiS3EjQL+WOkxEOA4KPxsohFnBDeyPYiNm4ZvkQdLnece36opYidmtbmow==", + "license": "MIT", "dependencies": { "@walletconnect/jsonrpc-utils": "^1.0.8", "@walletconnect/safe-json": "^1.0.2", @@ -23732,31 +23743,34 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/@walletconnect/jsonrpc-types/-/jsonrpc-types-1.0.4.tgz", "integrity": "sha512-P6679fG/M+wuWg9TY8mh6xFSdYnFyFjwFelxyISxMDrlbXokorEVXYOxiqEbrU3x1BmBoCAJJ+vtEaEoMlpCBQ==", + "license": "MIT", "dependencies": { "events": "^3.3.0", "keyvaluestorage-interface": "^1.0.0" } }, "packages/taquito-wallet-connect-2/node_modules/@walletconnect/sign-client": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.15.2.tgz", - "integrity": "sha512-Yp4/z3IdTMngbjr7Zy7Qi1X6EZDH4nxY91X6K2KpA3MjLW0yPTGalEJgJ4p9WH7fmHRlwvfR4hjwM5eQcLo5Zg==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.16.1.tgz", + "integrity": "sha512-s2Tx2n2duxt+sHtuWXrN9yZVaHaYqcEcjwlTD+55/vs5NUPlISf+fFmZLwSeX1kUlrSBrAuxPUcqQuRTKcjLOA==", + "license": "Apache-2.0", "dependencies": { - "@walletconnect/core": "2.15.2", + "@walletconnect/core": "2.16.1", "@walletconnect/events": "1.0.1", "@walletconnect/heartbeat": "1.2.2", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/logger": "2.1.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.15.2", - "@walletconnect/utils": "2.15.2", + "@walletconnect/types": "2.16.1", + "@walletconnect/utils": "2.16.1", "events": "3.3.0" } }, "packages/taquito-wallet-connect-2/node_modules/@walletconnect/types": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.15.2.tgz", - "integrity": "sha512-TGnQZYWZJJ3I8dqgpMPwhO1IRXDuY8/tWPI0nNWJDyTK7b3E9prDGugnPmDDjpTYVoETnUTgW/jQaHNTq4yV7Q==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.16.1.tgz", + "integrity": "sha512-9P4RG4VoDEF+yBF/n2TF12gsvT/aTaeZTVDb/AOayafqiPnmrQZMKmNCJJjq1sfdsDcHXFcZWMGsuCeSJCmrXA==", + "license": "Apache-2.0", "dependencies": { "@walletconnect/events": "1.0.1", "@walletconnect/heartbeat": "1.2.2", @@ -23767,9 +23781,10 @@ } }, "packages/taquito-wallet-connect-2/node_modules/@walletconnect/utils": { - "version": "2.15.2", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.15.2.tgz", - "integrity": "sha512-H+fNH9cHDezdaEiEsO7/3URSIzqhumuacwB/+0PX0sSCoktmU9AfTqA8fJGG43zOPixleBqOymzO6owB1Y7jtQ==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.16.1.tgz", + "integrity": "sha512-aoQirVoDoiiEtYeYDtNtQxFzwO/oCrz9zqeEEXYJaAwXlGVTS34KFe7W3/Rxd/pldTYKFOZsku2EzpISfH8Wsw==", + "license": "Apache-2.0", "dependencies": { "@stablelib/chacha20poly1305": "1.0.1", "@stablelib/hkdf": "1.0.1", @@ -23780,7 +23795,7 @@ "@walletconnect/relay-auth": "1.0.4", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.15.2", + "@walletconnect/types": "2.16.1", "@walletconnect/window-getters": "1.0.1", "@walletconnect/window-metadata": "1.0.1", "detect-browser": "5.3.0", @@ -23793,6 +23808,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", + "license": "MIT", "dependencies": { "multiformats": "^9.4.2" } diff --git a/packages/taquito-wallet-connect-2/package.json b/packages/taquito-wallet-connect-2/package.json index d648ff6cba..3ce9de377a 100644 --- a/packages/taquito-wallet-connect-2/package.json +++ b/packages/taquito-wallet-connect-2/package.json @@ -68,9 +68,9 @@ "dependencies": { "@taquito/taquito": "^20.0.1", "@walletconnect/legacy-modal": "^2.0.0", - "@walletconnect/sign-client": "^2.15.2", - "@walletconnect/types": "^2.15.2", - "@walletconnect/utils": "^2.15.2" + "@walletconnect/sign-client": "^2.16.1", + "@walletconnect/types": "^2.16.1", + "@walletconnect/utils": "^2.16.1" }, "devDependencies": { "@types/bluebird": "^3.5.42", diff --git a/website/package-lock.json b/website/package-lock.json index 34bcd8da77..14c0e6308c 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -33,6 +33,7 @@ "@taquito/tzip12": "file:../packages/taquito-tzip12", "@taquito/tzip16": "file:../packages/taquito-tzip16", "@taquito/utils": "file:../packages/taquito-utils", + "@taquito/wallet-connect-2": "file:../packages/taquito-wallet-connect-2", "abort-controller": "^3.0.0", "algoliasearch": "^4.23.2", "axios": "^0.28.0", @@ -63,6 +64,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.4.3", "@tsconfig/docusaurus": "^2.0.2", + "lokijs": "^1.5.12", "typescript": "^5.2.2" } }, @@ -622,6 +624,51 @@ "node": ">=20" } }, + "../packages/taquito-wallet-connect-2": { + "name": "@taquito/wallet-connect-2", + "version": "20.0.1", + "license": "Apache-2.0", + "dependencies": { + "@taquito/taquito": "^20.0.1", + "@walletconnect/legacy-modal": "^2.0.0", + "@walletconnect/sign-client": "^2.16.1", + "@walletconnect/types": "^2.16.1", + "@walletconnect/utils": "^2.16.1" + }, + "devDependencies": { + "@types/bluebird": "^3.5.42", + "@types/chrome": "0.0.171", + "@types/jest": "^29.5.12", + "@types/node": "^22", + "@types/pino": "^7.0.5", + "@types/ws": "^8.5.12", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "colors": "^1.4.0", + "coveralls": "^3.1.1", + "cross-env": "^7.0.3", + "eslint": "^8.57.0", + "jest": "^29.7.0", + "jest-config": "^29.7.0", + "lint-staged": "^15.2.7", + "lodash.camelcase": "^4.3.0", + "prettier": "^3.3.3", + "prompt": "^1.3.0", + "replace-in-file": "^8.1.0", + "rimraf": "^6.0.1", + "rollup": "^4.19.1", + "rollup-plugin-json": "^4.0.0", + "rollup-plugin-typescript2": "^0.36.0", + "shelljs": "^0.8.5", + "ts-jest": "^29.2.3", + "ts-node": "^10.9.2", + "ts-toolbelt": "^9.6.0", + "typescript": "~5.5.4" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/@algolia/autocomplete-core": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/@algolia/autocomplete-core/-/autocomplete-core-1.9.3.tgz", @@ -7026,6 +7073,10 @@ "resolved": "../packages/taquito-utils", "link": true }, + "node_modules/@taquito/wallet-connect-2": { + "resolved": "../packages/taquito-wallet-connect-2", + "link": true + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", @@ -8429,9 +8480,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -8442,7 +8493,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -8476,6 +8527,21 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, + "node_modules/body-parser/node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/bonjour-service": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.2.1.tgz", @@ -11917,37 +11983,37 @@ "license": "Apache-2.0" }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "^1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -11979,6 +12045,15 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -11986,9 +12061,9 @@ "license": "MIT" }, "node_modules/express/node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "license": "MIT" }, "node_modules/express/node_modules/range-parser": { @@ -13755,7 +13830,7 @@ "node": ">=12.0.0" }, "peerDependencies": { - "@types/express": "^4.17.13" + "@types/express": "^4.17.21" }, "peerDependenciesMeta": { "@types/express": { @@ -14590,12 +14665,6 @@ "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", "license": "MIT" }, - "node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", - "license": "MIT" - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -15528,6 +15597,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lokijs": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/lokijs/-/lokijs-1.5.12.tgz", + "integrity": "sha512-Q5ALD6JiS6xAUWCwX3taQmgwxyveCtIIuL08+ml0nHwT3k0S/GIFJN+Hd38b1qYIMaE5X++iqsqWVksz7SYW+Q==", + "dev": true, + "license": "MIT" + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -15874,10 +15950,13 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "license": "MIT" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -18070,13 +18149,10 @@ } }, "node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "license": "MIT", - "dependencies": { - "isarray": "0.0.1" - } + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-3.3.0.tgz", + "integrity": "sha512-qyCH421YQPS2WFDxDjftfc1ZR5WKQzVzqsp4n9M2kQhVOo/ByahFoUNJfl58kOcEGfQ//7weFTDhm+ss8Ecxgw==", + "license": "MIT" }, "node_modules/path-type": { "version": "4.0.0", @@ -19660,7 +19736,7 @@ "history": "^4.9.0", "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", - "path-to-regexp": "^1.7.0", + "path-to-regexp": "^3.3.0", "prop-types": "^15.6.2", "react-is": "^16.6.0", "tiny-invariant": "^1.0.2", @@ -21079,9 +21155,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -21153,7 +21229,7 @@ "mime-types": "2.1.18", "minimatch": "3.1.2", "path-is-inside": "1.0.2", - "path-to-regexp": "2.2.1", + "path-to-regexp": "3.3.0", "range-parser": "1.2.0" } }, @@ -21190,12 +21266,6 @@ "node": "*" } }, - "node_modules/serve-handler/node_modules/path-to-regexp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", - "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==", - "license": "MIT" - }, "node_modules/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", @@ -21275,20 +21345,29 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "license": "MIT", "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -24004,7 +24083,7 @@ "dependencies": { "@types/bonjour": "^3.5.9", "@types/connect-history-api-fallback": "^1.3.5", - "@types/express": "^4.17.13", + "@types/express": "^4.17.21", "@types/serve-index": "^1.9.1", "@types/serve-static": "^1.13.10", "@types/sockjs": "^0.3.33", @@ -24016,7 +24095,7 @@ "compression": "^1.7.4", "connect-history-api-fallback": "^2.0.0", "default-gateway": "^6.0.3", - "express": "^4.17.3", + "express": "^4.20.0", "graceful-fs": "^4.2.6", "html-entities": "^2.3.2", "http-proxy-middleware": "^2.0.3", diff --git a/website/package.json b/website/package.json index 1ad94604c9..d9d3fe6d05 100644 --- a/website/package.json +++ b/website/package.json @@ -40,6 +40,7 @@ "@taquito/tzip12": "file:../packages/taquito-tzip12", "@taquito/tzip16": "file:../packages/taquito-tzip16", "@taquito/utils": "file:../packages/taquito-utils", + "@taquito/wallet-connect-2": "file:../packages/taquito-wallet-connect-2", "abort-controller": "^3.0.0", "algoliasearch": "^4.23.2", "axios": "^0.28.0", @@ -70,6 +71,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "2.4.3", "@tsconfig/docusaurus": "^2.0.2", + "lokijs": "^1.5.12", "typescript": "^5.2.2" }, "browserslist": { diff --git a/website/sidebars.js b/website/sidebars.js index 1bd49b70f0..8cf71fdf22 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -85,6 +85,7 @@ const sidebars = { 'beaconwallet-singleton', 'wallets', 'transaction_limits', + 'wallet_connect_2', ], }, { diff --git a/website/src/theme/CodeBlock/index.js b/website/src/theme/CodeBlock/index.js index 039eb162ec..98d1eb6544 100755 --- a/website/src/theme/CodeBlock/index.js +++ b/website/src/theme/CodeBlock/index.js @@ -88,6 +88,7 @@ export default ({ const { Schema, ParameterSchema, Token } = await import("@taquito/michelson-encoder"); const { Parser, packDataBytes, emitMicheline } = await import('@taquito/michel-codec'); const { RpcClient } = await import('@taquito/rpc'); + const { WalletConnect2, PermissionScopeMethods, NetworkType } = await import('@taquito/wallet-connect-2'); const TransportWebHID = (await import("@ledgerhq/hw-transport-webhid")).default; let wallet; @@ -140,6 +141,9 @@ export default ({ emitMicheline, RpcReadAdapter, RpcClient, + WalletConnect2, + PermissionScopeMethods, + NetworkType, Ed25519, ECDSA, Path, @@ -202,6 +206,9 @@ export default ({ RpcClient: dependencies?.RpcClient, InMemorySpendingKey: dependencies?.InMemorySpendingKey, InMemoryViewingKey: dependencies?.InMemoryViewingKey, + WalletConnect2: dependencies?.WalletConnect2, + PermissionScopeMethods: dependencies?.PermissionScopeMethods, + NetworkType: dependencies?.NetworkType, Ed25519: dependencies?.Ed25519, ECDSA: dependencies?.ECDSA, Path: dependencies?.Path, diff --git a/website/src/theme/Playground/index.js b/website/src/theme/Playground/index.js index ad30778705..3589655a60 100755 --- a/website/src/theme/Playground/index.js +++ b/website/src/theme/Playground/index.js @@ -68,6 +68,10 @@ class SemiLiveProvider extends LiveProvider { let console = {log: value => render("" + value + "\\n")}; +// Needed for the wallet connect 2 live code example +// https://cloud.walletconnect.com/sign-in +const MY_PROJECT_ID = 'ba97fd7d1e89eae02f7c330e14ce1f36' + ${template()} //contract used in example "estimate a contract origination"