diff --git a/examples/3-minimal-with-verify/package.json b/examples/3-minimal-with-verify/package.json index d33180a..e1dbda4 100644 --- a/examples/3-minimal-with-verify/package.json +++ b/examples/3-minimal-with-verify/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" diff --git a/examples/4-minimal-with-webhook/package.json b/examples/4-minimal-with-webhook/package.json index 734a0d1..b234dc7 100644 --- a/examples/4-minimal-with-webhook/package.json +++ b/examples/4-minimal-with-webhook/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" diff --git a/examples/5-example-purchase-flow/package.json b/examples/5-example-purchase-flow/package.json index 0bf4308..f5bbda9 100644 --- a/examples/5-example-purchase-flow/package.json +++ b/examples/5-example-purchase-flow/package.json @@ -11,8 +11,8 @@ "author": "", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", - "@code-wallet/library": "^1.0.0", + "@code-wallet/client": "^2.0.2", + "@code-wallet/library": "^1.3.1", "@markdoc/markdoc": "^0.3.2", "body-parser": "^1.20.2", "dotenv": "^16.3.1", diff --git a/examples/6-minimal-with-login/package.json b/examples/6-minimal-purchase-with-login/package.json similarity index 92% rename from examples/6-minimal-with-login/package.json rename to examples/6-minimal-purchase-with-login/package.json index 6250a90..7fae19d 100644 --- a/examples/6-minimal-with-login/package.json +++ b/examples/6-minimal-purchase-with-login/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.1.2", + "@code-wallet/client": "^1.3.1", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" diff --git a/examples/6-minimal-with-login/server.js b/examples/6-minimal-purchase-with-login/server.js similarity index 85% rename from examples/6-minimal-with-login/server.js rename to examples/6-minimal-purchase-with-login/server.js index fddce0a..dce5cb5 100644 --- a/examples/6-minimal-with-login/server.js +++ b/examples/6-minimal-purchase-with-login/server.js @@ -20,11 +20,17 @@ app.get('/success/:id', async (req, res) => { // Get the payment intent id from the URL const intent = req.params.id; - // Get the status of the payment intent and the user's public key - const status = await code.paymentIntents.getStatus({ intent }); + try { + // Get the status of the payment intent + const status = await code.getStatus({ intent }); + const user = await code.getUserId({ intent, verifier }); - // Render the success page with the intent id and status - res.render('success', { intent, status }); + // Render the success page with the intent id and status + res.render('success', { intent, status, user }); + } catch (e) { + console.log('error', e); + res.json({ error: e.message }); + } }); // This is a JSON file that Code will look for when verifying your domain. It @@ -64,6 +70,7 @@ app.post('/create-intent', async (req, res) => { res.send({ clientSecret }); }); + app.listen(port, () => { console.log(`🚀 Minimal example listening on port ${port}`) console.log(`http://localhost:${port}`) diff --git a/examples/6-minimal-with-login/views/index.ejs b/examples/6-minimal-purchase-with-login/views/index.ejs similarity index 87% rename from examples/6-minimal-with-login/views/index.ejs rename to examples/6-minimal-purchase-with-login/views/index.ejs index 271aa29..38a9503 100644 --- a/examples/6-minimal-with-login/views/index.ejs +++ b/examples/6-minimal-purchase-with-login/views/index.ejs @@ -4,7 +4,7 @@ - Code SDK - Example/6-minimal-with-login + Code SDK - Example/6-minimal-purchase-with-login @@ -16,6 +16,7 @@ const hostname = window.location.protocol + "//" + window.location.host; const { button } = code.elements.create('button', { + mode: 'payment', currency: 'usd', destination: 'E8otxw1CVX9bfyddKu3ZB3BVLa4VVF9J7CTPdnUwT9jR', amount: 0.05, @@ -29,7 +30,7 @@ // Wait for the button to be clicked button.on('invoke', async () => { - // Get a payment intent from our own server + // Get a payment intent clientSecret value from server.js const res = await fetch('/create-intent', { method: 'POST' }); const { clientSecret } = await res.json(); diff --git a/examples/6-minimal-purchase-with-login/views/success.ejs b/examples/6-minimal-purchase-with-login/views/success.ejs new file mode 100644 index 0000000..fbb3a16 --- /dev/null +++ b/examples/6-minimal-purchase-with-login/views/success.ejs @@ -0,0 +1,17 @@ + + + + + + + + Code SDK - Example/6-minimal-purchase-with-login + + + +
Intent Id: <%= intent %>
+
Status:
<%= JSON.stringify(status, null, 2) %>
+
User:
<%= JSON.stringify(user, null, 2) %>
+ + + \ No newline at end of file diff --git a/examples/7-minimal-login/package.json b/examples/7-minimal-login/package.json new file mode 100644 index 0000000..b4fa29a --- /dev/null +++ b/examples/7-minimal-login/package.json @@ -0,0 +1,22 @@ +{ + "name": "7-minimal-with-login", + "version": "1.0.0", + "description": "", + "main": "index.js", + "type": "module", + "scripts": { + "start": "node server.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@code-wallet/client": "^2.0.6", + "body-parser": "^1.20.2", + "ejs": "^3.1.9", + "express": "^4.18.2" + }, + "devDependencies": { + "@types/express": "^4.17.17" + } +} diff --git a/examples/7-minimal-login/server.js b/examples/7-minimal-login/server.js new file mode 100644 index 0000000..9a7d603 --- /dev/null +++ b/examples/7-minimal-login/server.js @@ -0,0 +1,73 @@ +import * as code from "@code-wallet/client"; +import { Keypair } from "@code-wallet/library"; +import express from "express"; + +const port = process.env.PORT || 3080; +const hostname = process.env.HOSTNAME || 'example.com'; +const app = express(); +const verifier = Keypair.generate(); + +// Set the view engine to ejs +app.set('view engine', 'ejs'); + +// index page (with the login button) +app.get('/', async function(req, res) { + res.render('index', { domain: hostname, verifier: verifier.getPublicKey().toBase58() }); +}); + +// This is a page that the user will be redirected to once the login is made. +app.get('/success/:id', async (req, res) => { + // Get the login intent id from the URL + const intent = req.params.id; + + try { + // Get the status of the login intent + const status = await code.getStatus({ intent }); + const user = await code.getUserId({ intent, verifier }); + + // Render the success page with the intent id and status + res.render('success', { intent, status, user }); + } catch (e) { + console.log('error', e); + res.json({ error: e.message }); + } +}); + +// This is a JSON file that Code will look for when verifying your domain. It +// should be publicly accessible at the root of your domain. For example: +// https://example.com/.well-known/code-payments.json +app.get('/.well-known/code-payments.json', (req, res) => { + res.json({ "public_keys": [verifier.getPublicKey().toBase58()] }); +}); + +// Create a login intent. We're letting Code know that a login is coming +// soon and we want to be notified once it's made. +app.post('/create-intent', async (req, res) => { + + const { clientSecret, id } = await code.loginIntents.create({ + login: { + verifier: verifier.getPublicKey().toBase58(), + + // Cannot be localhost or a subdomain. It must be a domain that you own + // and have access to. Code will verify that this domain is owned by you + // by looking for the .well-known/code-payments.json file. + domain: hostname, + }, + + signers: [ verifier ], + }); + + console.log('Created intent', id); + + // The clientSecret value needs to be sent to the browser so that the browser + // can use it to setup a login with this intent instance. The client will + // use the login details along with this value to derive the same login + // intent id on its end. + res.send({ clientSecret }); +}); + + +app.listen(port, () => { + console.log(`🚀 Minimal example listening on port ${port}`) + console.log(`http://localhost:${port}`) +}); diff --git a/examples/7-minimal-login/views/index.ejs b/examples/7-minimal-login/views/index.ejs new file mode 100644 index 0000000..3de4667 --- /dev/null +++ b/examples/7-minimal-login/views/index.ejs @@ -0,0 +1,50 @@ + + + + + + + Code SDK - Example/7-minimal-login + + + +
+ + + + + \ No newline at end of file diff --git a/examples/6-minimal-with-login/views/success.ejs b/examples/7-minimal-login/views/success.ejs similarity index 70% rename from examples/6-minimal-with-login/views/success.ejs rename to examples/7-minimal-login/views/success.ejs index e5cb46e..e2aacab 100644 --- a/examples/6-minimal-with-login/views/success.ejs +++ b/examples/7-minimal-login/views/success.ejs @@ -5,13 +5,13 @@ - Code SDK - Example/6-minimal-with-login + Code SDK - Example/7-minimal-login -

Payment Intent

Intent Id: <%= intent %>
Status:
<%= JSON.stringify(status, null, 2) %>
+
User:
<%= JSON.stringify(user, null, 2) %>
\ No newline at end of file diff --git a/examples/package-lock.json b/examples/package-lock.json index d73dd86..e2c7677 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -16,10 +16,33 @@ }, "../packages/client": { "name": "@code-wallet/client", - "version": "1.1.0", + "version": "2.0.0", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + }, + "devDependencies": { + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/node": "^20.5.7", + "chai": "^4.3.8", + "ts-mocha": "^10.0.0", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + } + }, + "../packages/library": { + "name": "@code-wallet/library", + "version": "1.3.3", "license": "MIT", "dependencies": { - "@code-wallet/library": "^1.1.0", + "@code-wallet/rpc": "^1.3.1", + "@noble/curves": "^1.2.0", + "@noble/hashes": "^1.3.0", "bs58": "^5.0.0", "buffer": "6.0.3" }, @@ -28,6 +51,28 @@ "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", "chai": "^4.3.8", + "esm": "^3.2.25", + "ts-mocha": "^10.0.0", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + } + }, + "../packages/rpc": { + "name": "@code-wallet/rpc", + "version": "1.3.1", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@bufbuild/connect": "^0.8.6", + "@bufbuild/connect-web": "^0.8.6", + "@bufbuild/protobuf": "^1.3.1" + }, + "devDependencies": { + "@types/chai": "^4.3.5", + "@types/mocha": "^10.0.1", + "@types/node": "^20.5.7", + "chai": "^4.3.8", + "esm": "^3.2.25", "ts-mocha": "^10.0.0", "ts-node": "^10.9.1", "typescript": "^5.1.6" @@ -60,7 +105,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" @@ -69,11 +114,22 @@ "@types/express": "^4.17.17" } }, + "3-minimal-with-verify/node_modules/@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "dependencies": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, "4-minimal-with-webhook": { "version": "1.0.0", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" @@ -82,12 +138,23 @@ "@types/express": "^4.17.17" } }, + "4-minimal-with-webhook/node_modules/@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "dependencies": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, "5-example-purchase-flow": { "version": "1.0.0", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.0.0", - "@code-wallet/library": "^1.0.0", + "@code-wallet/client": "^2.0.2", + "@code-wallet/library": "^1.3.1", "@markdoc/markdoc": "^0.3.2", "body-parser": "^1.20.2", "dotenv": "^16.3.1", @@ -109,11 +176,37 @@ "ts-node-dev": "^2.0.0" } }, - "6-minimal-with-login": { + "6-minimal-purchase-with-login": { + "name": "6-minimal-with-login", "version": "1.0.0", "license": "ISC", "dependencies": { - "@code-wallet/client": "^1.1.0", + "@code-wallet/client": "^1.3.1", + "body-parser": "^1.20.2", + "ejs": "^3.1.9", + "express": "^4.18.2" + }, + "devDependencies": { + "@types/express": "^4.17.17" + } + }, + "6-minimal-purchase-with-login/node_modules/@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "dependencies": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, + "7-minimal-login": { + "name": "7-minimal-with-login", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@code-wallet/client": "^2.0.6", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" @@ -123,9 +216,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -137,6 +230,7 @@ "version": "0.8.6", "resolved": "https://registry.npmjs.org/@bufbuild/connect/-/connect-0.8.6.tgz", "integrity": "sha512-z9gW4hcQxCz7w0kjt1JyMp7VEQQdm7CYiZHvNq4vZtMbKOje2DC8kSb62XStHHd3AdoDZq1cb1s11F5TMSwZYw==", + "deprecated": "Connect has moved to its own org @connectrpc and has a stable v1. Run `npx @connectrpc/connect-migrate@latest` to update. See https://github.com/connectrpc/connect-es/releases/tag/v0.13.1 for details.", "peerDependencies": { "@bufbuild/protobuf": "^1.2.0" } @@ -145,6 +239,7 @@ "version": "0.8.6", "resolved": "https://registry.npmjs.org/@bufbuild/connect-web/-/connect-web-0.8.6.tgz", "integrity": "sha512-+ZI7Ercc0X1vlQr1iHa35EymtFjq1x4rByE+ToNyw05mwB7yxk4nw4iUa/Z7PfHYba1dAcgnnrvRDI2K7TBPBQ==", + "deprecated": "Connect has moved to its own org @connectrpc and has a stable v1. Run `npx @connectrpc/connect-migrate@latest` to update. See https://github.com/connectrpc/connect-es/releases/tag/v0.13.1 for details.", "dependencies": { "@bufbuild/connect": "0.8.6" }, @@ -153,30 +248,29 @@ } }, "node_modules/@bufbuild/protobuf": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.3.1.tgz", - "integrity": "sha512-BUyJWutgP2S8K/1NphOJokuwDckXS4qI2T1pGZAlkFdZchWae3jm6fCdkcGbLlM1QLOcNFFePd+7Feo4BYGrJQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.6.0.tgz", + "integrity": "sha512-hp19vSFgNw3wBBcVBx5qo5pufCqjaJ0Cfk5H/pfjNOfNWU+4/w0QVOmfAOZNRrNWRrVuaJWxcN8P2vhOkkzbBQ==" }, "node_modules/@code-wallet/client": { - "resolved": "../packages/client", - "link": true - }, - "node_modules/@code-wallet/library": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@code-wallet/library/-/library-1.0.0.tgz", - "integrity": "sha512-XefO1b1l+Qs76nJK+NPnUiI706ivHKU1pJbxkBS4a6fIi5SbauCQFWkcC+U+X2R/aOnfcRSaWnszFP7feVG8tg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-2.0.6.tgz", + "integrity": "sha512-YHSsmKz1PK6EfKwlFUyy5I07++Kwii/Kcq/WaobakT1dvj5dBrlaGaJ/d7lv5Nl1yp8mi1NhCeS4abgGvkSBhQ==", "dependencies": { - "@code-wallet/rpc": "^1.0.0", - "@noble/curves": "^1.2.0", - "@noble/hashes": "^1.3.0", + "@code-wallet/library": "^1.3.2", + "@code-wallet/rpc": "^1.3.1", "bs58": "^5.0.0", "buffer": "6.0.3" } }, + "node_modules/@code-wallet/library": { + "resolved": "../packages/library", + "link": true + }, "node_modules/@code-wallet/rpc": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@code-wallet/rpc/-/rpc-1.0.0.tgz", - "integrity": "sha512-rVLv3GfkJe7eZOzi03PB8HQiIaFQmqMiVyEHiKG+7VQnDx5XzPquaZXjkaGpjt3M8q0KkMJzmPotCESiEtOeLA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/rpc/-/rpc-1.3.1.tgz", + "integrity": "sha512-s9K2V7/YCQ8l4ldLhces16BR3w8+kZQ2Qk2+UsvwOpozlN426Uoo1w4QZk3Jtk+5laAVgA9cvokhKD9+D+LTEg==", "dependencies": { "@bufbuild/connect": "^0.8.6", "@bufbuild/connect-web": "^0.8.6", @@ -217,9 +311,9 @@ } }, "node_modules/@markdoc/markdoc": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@markdoc/markdoc/-/markdoc-0.3.2.tgz", - "integrity": "sha512-D0SaanaSkTIARvQu+zQqPEpKcvYUBR/mfac9e8JzS89P7eXhiNWPonUN7avRS1saZHpIQWIRote97qT+jGk5Gw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@markdoc/markdoc/-/markdoc-0.3.5.tgz", + "integrity": "sha512-Z3agu2wnodoOYd5kzKbtwZduSfX19Kbsg/FlK0TeMn29cTTEEVPJtjfgKSMTN/Wq+kUQXnPtOEhHRgke5d/Xiw==", "engines": { "node": ">=14.7.0" }, @@ -239,28 +333,6 @@ } } }, - "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/@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/@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -282,9 +354,9 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" }, "node_modules/@types/body-parser": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.3.tgz", - "integrity": "sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "dev": true, "dependencies": { "@types/connect": "*", @@ -292,30 +364,30 @@ } }, "node_modules/@types/chance": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@types/chance/-/chance-1.1.4.tgz", - "integrity": "sha512-et3alUWI9jEPnGai+QRCyDdRMYS+atq32IaldWURyxPRZBYg+cSwppxK2UHnDv9X/0pdoxR3Ufbz5hRmjD/uNg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@types/chance/-/chance-1.1.6.tgz", + "integrity": "sha512-V+pm3stv1Mvz8fSKJJod6CglNGVqEQ6OyuqitoDkWywEODM/eJd1eSuIp9xt6DrX8BWZ2eDSIzbw1tPCUTvGbQ==", "dev": true }, "node_modules/@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/ejs": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/ejs/-/ejs-3.1.3.tgz", - "integrity": "sha512-mv5T/JI/bu+pbfz1o+TLl1NF0NIBbjS0Vl6Ppz1YY9DkXfzZT0lelXpfS5i3ZS3U/p90it7uERQpBvLYoK8e4A==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/ejs/-/ejs-3.1.5.tgz", + "integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==", "dev": true }, "node_modules/@types/express": { - "version": "4.17.18", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.18.tgz", - "integrity": "sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "dependencies": { "@types/body-parser": "*", @@ -325,9 +397,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.37", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.37.tgz", - "integrity": "sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "dev": true, "dependencies": { "@types/node": "*", @@ -337,21 +409,21 @@ } }, "node_modules/@types/http-errors": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.2.tgz", - "integrity": "sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", "dev": true }, "node_modules/@types/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz", + "integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==", "optional": true }, "node_modules/@types/lodash": { - "version": "4.14.199", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.199.tgz", - "integrity": "sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==", + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", "dev": true }, "node_modules/@types/markdown-it": { @@ -365,38 +437,41 @@ } }, "node_modules/@types/mdurl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.3.tgz", - "integrity": "sha512-T5k6kTXak79gwmIOaDF2UUQXFbnBE0zBUzF20pz7wDYu0RQMzWg+Ml/Pz50214NsFHBITkoi5VtdjFZnJ2ijjA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz", + "integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==", "optional": true }, "node_modules/@types/mime": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.3.tgz", - "integrity": "sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, "node_modules/@types/node": { - "version": "20.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", - "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==" + "version": "20.11.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.4.tgz", + "integrity": "sha512-6I0fMH8Aoy2lOejL3s4LhyIYX34DPwY8bl5xlNjBvUEk8OHrcuzsFt+Ied4LvJihbtXPM+8zUqdydfIti86v9g==", + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/qs": { - "version": "6.9.8", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", - "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==", + "version": "6.9.11", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", "dev": true }, "node_modules/@types/range-parser": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.5.tgz", - "integrity": "sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "dev": true }, "node_modules/@types/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.2.tgz", - "integrity": "sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw==", + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "dev": true, "dependencies": { "@types/mime": "^1", @@ -404,9 +479,9 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.3.tgz", - "integrity": "sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "dev": true, "dependencies": { "@types/http-errors": "*", @@ -427,106 +502,94 @@ "dev": true }, "node_modules/@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.14.tgz", + "integrity": "sha512-ro4Zzl/MPdWs7XwxT7omHRxAjMbDFRZEEjD+2m3NBf8YzAe3HuoSEZosXQo+m1GQ1G3LQ1LdmNh1RKTYe+ssEg==", "dependencies": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.14", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.14.tgz", + "integrity": "sha512-nOZTY+veWNa0DKAceNWxorAbWm0INHdQq7cejFaWM1WYnoNSJbSEKYtE7Ir6lR/+mo9fttZpPVI9ZFGJ1juUEQ==", "dependencies": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-core": "3.4.14", + "@vue/shared": "3.4.14" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", - "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", - "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-ssr": "3.3.4", - "@vue/reactivity-transform": "3.3.4", - "@vue/shared": "3.3.4", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.14.tgz", + "integrity": "sha512-1vHc9Kv1jV+YBZC/RJxQJ9JCxildTI+qrhtDh6tPkR1O8S+olBUekimY0km0ZNn8nG1wjtFAe9XHij+YLR8cRQ==", + "dependencies": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.14", + "@vue/compiler-dom": "3.4.14", + "@vue/compiler-ssr": "3.4.14", + "@vue/shared": "3.4.14", "estree-walker": "^2.0.2", - "magic-string": "^0.30.0", - "postcss": "^8.1.10", + "magic-string": "^0.30.5", + "postcss": "^8.4.33", "source-map-js": "^1.0.2" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", - "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.14.tgz", + "integrity": "sha512-bXT6+oAGlFjTYVOTtFJ4l4Jab1wjsC0cfSfOe2B4Z0N2vD2zOBSQ9w694RsCfhjk+bC2DY5Gubb1rHZVii107Q==", "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.14", + "@vue/shared": "3.4.14" } }, "node_modules/@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.14.tgz", + "integrity": "sha512-xRYwze5Q4tK7tT2J4uy4XLhK/AIXdU5EBUu9PLnIHcOKXO0uyXpNNMzlQKuq7B+zwtq6K2wuUL39pHA6ZQzObw==", "dependencies": { - "@vue/shared": "3.3.4" - } - }, - "node_modules/@vue/reactivity-transform": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", - "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", - "dependencies": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.0" + "@vue/shared": "3.4.14" } }, "node_modules/@vue/runtime-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", - "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.14.tgz", + "integrity": "sha512-qu+NMkfujCoZL6cfqK5NOfxgXJROSlP2ZPs4CTcVR+mLrwl4TtycF5Tgo0QupkdBL+2kigc6EsJlTcuuZC1NaQ==", "dependencies": { - "@vue/reactivity": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/reactivity": "3.4.14", + "@vue/shared": "3.4.14" } }, "node_modules/@vue/runtime-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", - "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.14.tgz", + "integrity": "sha512-B85XmcR4E7XsirEHVqhmy4HPbRT9WLFWV9Uhie3OapV9m1MEN9+Er6hmUIE6d8/l2sUygpK9RstFM2bmHEUigA==", "dependencies": { - "@vue/runtime-core": "3.3.4", - "@vue/shared": "3.3.4", - "csstype": "^3.1.1" + "@vue/runtime-core": "3.4.14", + "@vue/shared": "3.4.14", + "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", - "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.14.tgz", + "integrity": "sha512-pwSKXQfYdJBTpvWHGEYI+akDE18TXAiLcGn+Q/2Fj8wQSHWztoo7PSvfMNqu6NDhp309QXXbPFEGCU5p85HqkA==", "dependencies": { - "@vue/compiler-ssr": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-ssr": "3.4.14", + "@vue/shared": "3.4.14" }, "peerDependencies": { - "vue": "3.3.4" + "vue": "3.4.14" } }, "node_modules/@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.14.tgz", + "integrity": "sha512-nmi3BtLpvqXAWoRZ6HQ+pFJOHBU4UnH3vD3opgmwXac7vhaHKA9nj1VeGjMggdB9eLtW83eHyPCmOU1qzdsC7Q==" }, "node_modules/1-minimal": { "resolved": "1-minimal", @@ -549,7 +612,11 @@ "link": true }, "node_modules/6-minimal-with-login": { - "resolved": "6-minimal-with-login", + "resolved": "6-minimal-purchase-with-login", + "link": true + }, + "node_modules/7-minimal-with-login": { + "resolved": "7-minimal-login", "link": true }, "node_modules/accepts": { @@ -565,9 +632,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "bin": { "acorn": "bin/acorn" }, @@ -576,9 +643,9 @@ } }, "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "engines": { "node": ">=0.4.0" } @@ -621,9 +688,9 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, "node_modules/balanced-match": { "version": "1.0.2", @@ -753,12 +820,13 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -865,9 +933,9 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/debug": { "version": "2.6.9", @@ -877,6 +945,19 @@ "ms": "2.0.0" } }, + "node_modules/define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -949,6 +1030,17 @@ "node": ">= 0.8" } }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -1138,19 +1230,22 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1188,15 +1283,15 @@ "node": ">= 6" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dependencies": { - "function-bind": "^1.1.1" + "get-intrinsic": "^1.1.3" }, - "engines": { - "node": ">= 0.4.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { @@ -1207,6 +1302,17 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "dependencies": { + "get-intrinsic": "^1.2.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", @@ -1229,6 +1335,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -1310,12 +1427,12 @@ } }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1369,9 +1486,9 @@ } }, "node_modules/jose": { - "version": "4.14.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.6.tgz", - "integrity": "sha512-EqJPEUlZD0/CSUMubKtMaYUOtWe91tZXTWMJZoKSbLk+KtdhNdcvppH8lA9XwVu2V4Ailvsj0GBZJ2ZwDjfesQ==", + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", + "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -1382,9 +1499,9 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -1486,9 +1603,9 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "funding": [ { "type": "github", @@ -1520,9 +1637,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1593,9 +1710,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "funding": [ { "type": "opencollective", @@ -1611,7 +1728,7 @@ } ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -1680,9 +1797,9 @@ } }, "node_modules/resolve": { - "version": "1.22.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", - "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { "is-core-module": "^2.13.0", @@ -1774,6 +1891,21 @@ "node": ">= 0.8.0" } }, + "node_modules/set-function-length": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", + "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", + "dependencies": { + "define-data-property": "^1.1.1", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.2", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -1898,9 +2030,9 @@ } }, "node_modules/ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -1998,9 +2130,9 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2009,6 +2141,11 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -2039,15 +2176,23 @@ } }, "node_modules/vue": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", - "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.14.tgz", + "integrity": "sha512-Rop5Al/ZcBbBz+KjPZaZDgHDX0kUP4duEzDbm+1o91uxYUNmJrZSBuegsNIJvUGy+epLevNRNhLjm08VKTgGyw==", "dependencies": { - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-sfc": "3.3.4", - "@vue/runtime-dom": "3.3.4", - "@vue/server-renderer": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.14", + "@vue/compiler-sfc": "3.4.14", + "@vue/runtime-dom": "3.4.14", + "@vue/server-renderer": "3.4.14", + "@vue/shared": "3.4.14" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/wrappy": { @@ -2076,9 +2221,9 @@ }, "dependencies": { "@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==" + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==" }, "@bufbuild/connect": { "version": "0.8.6", @@ -2095,41 +2240,43 @@ } }, "@bufbuild/protobuf": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.3.1.tgz", - "integrity": "sha512-BUyJWutgP2S8K/1NphOJokuwDckXS4qI2T1pGZAlkFdZchWae3jm6fCdkcGbLlM1QLOcNFFePd+7Feo4BYGrJQ==" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.6.0.tgz", + "integrity": "sha512-hp19vSFgNw3wBBcVBx5qo5pufCqjaJ0Cfk5H/pfjNOfNWU+4/w0QVOmfAOZNRrNWRrVuaJWxcN8P2vhOkkzbBQ==" }, "@code-wallet/client": { - "version": "file:../packages/client", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-2.0.6.tgz", + "integrity": "sha512-YHSsmKz1PK6EfKwlFUyy5I07++Kwii/Kcq/WaobakT1dvj5dBrlaGaJ/d7lv5Nl1yp8mi1NhCeS4abgGvkSBhQ==", + "requires": { + "@code-wallet/library": "^1.3.2", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, + "@code-wallet/library": { + "version": "file:../packages/library", "requires": { - "@code-wallet/library": "^1.1.0", + "@code-wallet/rpc": "^1.3.1", + "@noble/curves": "^1.2.0", + "@noble/hashes": "^1.3.0", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", "bs58": "^5.0.0", "buffer": "6.0.3", "chai": "^4.3.8", + "esm": "^3.2.25", "ts-mocha": "^10.0.0", "ts-node": "^10.9.1", "typescript": "^5.1.6" } }, - "@code-wallet/library": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@code-wallet/library/-/library-1.0.0.tgz", - "integrity": "sha512-XefO1b1l+Qs76nJK+NPnUiI706ivHKU1pJbxkBS4a6fIi5SbauCQFWkcC+U+X2R/aOnfcRSaWnszFP7feVG8tg==", - "requires": { - "@code-wallet/rpc": "^1.0.0", - "@noble/curves": "^1.2.0", - "@noble/hashes": "^1.3.0", - "bs58": "^5.0.0", - "buffer": "6.0.3" - } - }, "@code-wallet/rpc": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@code-wallet/rpc/-/rpc-1.0.0.tgz", - "integrity": "sha512-rVLv3GfkJe7eZOzi03PB8HQiIaFQmqMiVyEHiKG+7VQnDx5XzPquaZXjkaGpjt3M8q0KkMJzmPotCESiEtOeLA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/rpc/-/rpc-1.3.1.tgz", + "integrity": "sha512-s9K2V7/YCQ8l4ldLhces16BR3w8+kZQ2Qk2+UsvwOpozlN426Uoo1w4QZk3Jtk+5laAVgA9cvokhKD9+D+LTEg==", "requires": { "@bufbuild/connect": "^0.8.6", "@bufbuild/connect-web": "^0.8.6", @@ -2164,26 +2311,13 @@ } }, "@markdoc/markdoc": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@markdoc/markdoc/-/markdoc-0.3.2.tgz", - "integrity": "sha512-D0SaanaSkTIARvQu+zQqPEpKcvYUBR/mfac9e8JzS89P7eXhiNWPonUN7avRS1saZHpIQWIRote97qT+jGk5Gw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@markdoc/markdoc/-/markdoc-0.3.5.tgz", + "integrity": "sha512-Z3agu2wnodoOYd5kzKbtwZduSfX19Kbsg/FlK0TeMn29cTTEEVPJtjfgKSMTN/Wq+kUQXnPtOEhHRgke5d/Xiw==", "requires": { "@types/markdown-it": "12.2.3" } }, - "@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "requires": { - "@noble/hashes": "1.3.2" - } - }, - "@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==" - }, "@tsconfig/node10": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", @@ -2205,9 +2339,9 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==" }, "@types/body-parser": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.3.tgz", - "integrity": "sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "dev": true, "requires": { "@types/connect": "*", @@ -2215,30 +2349,30 @@ } }, "@types/chance": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@types/chance/-/chance-1.1.4.tgz", - "integrity": "sha512-et3alUWI9jEPnGai+QRCyDdRMYS+atq32IaldWURyxPRZBYg+cSwppxK2UHnDv9X/0pdoxR3Ufbz5hRmjD/uNg==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@types/chance/-/chance-1.1.6.tgz", + "integrity": "sha512-V+pm3stv1Mvz8fSKJJod6CglNGVqEQ6OyuqitoDkWywEODM/eJd1eSuIp9xt6DrX8BWZ2eDSIzbw1tPCUTvGbQ==", "dev": true }, "@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dev": true, "requires": { "@types/node": "*" } }, "@types/ejs": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/@types/ejs/-/ejs-3.1.3.tgz", - "integrity": "sha512-mv5T/JI/bu+pbfz1o+TLl1NF0NIBbjS0Vl6Ppz1YY9DkXfzZT0lelXpfS5i3ZS3U/p90it7uERQpBvLYoK8e4A==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/@types/ejs/-/ejs-3.1.5.tgz", + "integrity": "sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==", "dev": true }, "@types/express": { - "version": "4.17.18", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.18.tgz", - "integrity": "sha512-Sxv8BSLLgsBYmcnGdGjjEjqET2U+AKAdCRODmMiq02FgjwuV75Ut85DRpvFjyw/Mk0vgUOliGRU0UUmuuZHByQ==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dev": true, "requires": { "@types/body-parser": "*", @@ -2248,9 +2382,9 @@ } }, "@types/express-serve-static-core": { - "version": "4.17.37", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.37.tgz", - "integrity": "sha512-ZohaCYTgGFcOP7u6aJOhY9uIZQgZ2vxC2yWoArY+FeDXlqeH66ZVBjgvg+RLVAS/DWNq4Ap9ZXu1+SUQiiWYMg==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "dev": true, "requires": { "@types/node": "*", @@ -2260,21 +2394,21 @@ } }, "@types/http-errors": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.2.tgz", - "integrity": "sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", "dev": true }, "@types/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.5.tgz", + "integrity": "sha512-yg6E+u0/+Zjva+buc3EIb+29XEg4wltq7cSmd4Uc2EE/1nUVmxyzpX6gUXD0V8jIrG0r7YeOGVIbYRkxeooCtw==", "optional": true }, "@types/lodash": { - "version": "4.14.199", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.199.tgz", - "integrity": "sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==", + "version": "4.14.202", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", "dev": true }, "@types/markdown-it": { @@ -2288,38 +2422,41 @@ } }, "@types/mdurl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.3.tgz", - "integrity": "sha512-T5k6kTXak79gwmIOaDF2UUQXFbnBE0zBUzF20pz7wDYu0RQMzWg+Ml/Pz50214NsFHBITkoi5VtdjFZnJ2ijjA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.5.tgz", + "integrity": "sha512-6L6VymKTzYSrEf4Nev4Xa1LCHKrlTlYCBMTlQKFuddo1CvQcE52I0mwfOJayueUC7MJuXOeHTcIU683lzd0cUA==", "optional": true }, "@types/mime": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.3.tgz", - "integrity": "sha512-Ys+/St+2VF4+xuY6+kDIXGxbNRO0mesVg0bbxEfB97Od1Vjpjx9KD1qxs64Gcb3CWPirk9Xe+PT4YiiHQ9T+eg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", "dev": true }, "@types/node": { - "version": "20.7.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.7.1.tgz", - "integrity": "sha512-LT+OIXpp2kj4E2S/p91BMe+VgGX2+lfO+XTpfXhh+bCk2LkQtHZSub8ewFBMGP5ClysPjTDFa4sMI8Q3n4T0wg==" + "version": "20.11.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.4.tgz", + "integrity": "sha512-6I0fMH8Aoy2lOejL3s4LhyIYX34DPwY8bl5xlNjBvUEk8OHrcuzsFt+Ied4LvJihbtXPM+8zUqdydfIti86v9g==", + "requires": { + "undici-types": "~5.26.4" + } }, "@types/qs": { - "version": "6.9.8", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", - "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==", + "version": "6.9.11", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.11.tgz", + "integrity": "sha512-oGk0gmhnEJK4Yyk+oI7EfXsLayXatCWPHary1MtcmbAifkobT9cM9yutG/hZKIseOU0MqbIwQ/u2nn/Gb+ltuQ==", "dev": true }, "@types/range-parser": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.5.tgz", - "integrity": "sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "dev": true }, "@types/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.2.tgz", - "integrity": "sha512-aAG6yRf6r0wQ29bkS+x97BIs64ZLxeE/ARwyS6wrldMm3C1MdKwCcnnEwMC1slI8wuxJOpiUH9MioC0A0i+GJw==", + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "dev": true, "requires": { "@types/mime": "^1", @@ -2327,9 +2464,9 @@ } }, "@types/serve-static": { - "version": "1.15.3", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.3.tgz", - "integrity": "sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "dev": true, "requires": { "@types/http-errors": "*", @@ -2350,103 +2487,91 @@ "dev": true }, "@vue/compiler-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", - "integrity": "sha512-cquyDNvZ6jTbf/+x+AgM2Arrp6G4Dzbb0R64jiG804HRMfRiFXWI6kqUVqZ6ZR0bQhIoQjB4+2bhNtVwndW15g==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.14.tgz", + "integrity": "sha512-ro4Zzl/MPdWs7XwxT7omHRxAjMbDFRZEEjD+2m3NBf8YzAe3HuoSEZosXQo+m1GQ1G3LQ1LdmNh1RKTYe+ssEg==", "requires": { - "@babel/parser": "^7.21.3", - "@vue/shared": "3.3.4", + "@babel/parser": "^7.23.6", + "@vue/shared": "3.4.14", + "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.0.2" } }, "@vue/compiler-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.4.tgz", - "integrity": "sha512-wyM+OjOVpuUukIq6p5+nwHYtj9cFroz9cwkfmP9O1nzH68BenTTv0u7/ndggT8cIQlnBeOo6sUT/gvHcIkLA5w==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.14.tgz", + "integrity": "sha512-nOZTY+veWNa0DKAceNWxorAbWm0INHdQq7cejFaWM1WYnoNSJbSEKYtE7Ir6lR/+mo9fttZpPVI9ZFGJ1juUEQ==", "requires": { - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-core": "3.4.14", + "@vue/shared": "3.4.14" } }, "@vue/compiler-sfc": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.4.tgz", - "integrity": "sha512-6y/d8uw+5TkCuzBkgLS0v3lSM3hJDntFEiUORM11pQ/hKvkhSKZrXW6i69UyXlJQisJxuUEJKAWEqWbWsLeNKQ==", - "requires": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-ssr": "3.3.4", - "@vue/reactivity-transform": "3.3.4", - "@vue/shared": "3.3.4", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.14.tgz", + "integrity": "sha512-1vHc9Kv1jV+YBZC/RJxQJ9JCxildTI+qrhtDh6tPkR1O8S+olBUekimY0km0ZNn8nG1wjtFAe9XHij+YLR8cRQ==", + "requires": { + "@babel/parser": "^7.23.6", + "@vue/compiler-core": "3.4.14", + "@vue/compiler-dom": "3.4.14", + "@vue/compiler-ssr": "3.4.14", + "@vue/shared": "3.4.14", "estree-walker": "^2.0.2", - "magic-string": "^0.30.0", - "postcss": "^8.1.10", + "magic-string": "^0.30.5", + "postcss": "^8.4.33", "source-map-js": "^1.0.2" } }, "@vue/compiler-ssr": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.4.tgz", - "integrity": "sha512-m0v6oKpup2nMSehwA6Uuu+j+wEwcy7QmwMkVNVfrV9P2qE5KshC6RwOCq8fjGS/Eak/uNb8AaWekfiXxbBB6gQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.14.tgz", + "integrity": "sha512-bXT6+oAGlFjTYVOTtFJ4l4Jab1wjsC0cfSfOe2B4Z0N2vD2zOBSQ9w694RsCfhjk+bC2DY5Gubb1rHZVii107Q==", "requires": { - "@vue/compiler-dom": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-dom": "3.4.14", + "@vue/shared": "3.4.14" } }, "@vue/reactivity": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", - "integrity": "sha512-kLTDLwd0B1jG08NBF3R5rqULtv/f8x3rOFByTDz4J53ttIQEDmALqKqXY0J+XQeN0aV2FBxY8nJDf88yvOPAqQ==", - "requires": { - "@vue/shared": "3.3.4" - } - }, - "@vue/reactivity-transform": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.4.tgz", - "integrity": "sha512-MXgwjako4nu5WFLAjpBnCj/ieqcjE2aJBINUNQzkZQfzIZA4xn+0fV1tIYBJvvva3N3OvKGofRLvQIwEQPpaXw==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.14.tgz", + "integrity": "sha512-xRYwze5Q4tK7tT2J4uy4XLhK/AIXdU5EBUu9PLnIHcOKXO0uyXpNNMzlQKuq7B+zwtq6K2wuUL39pHA6ZQzObw==", "requires": { - "@babel/parser": "^7.20.15", - "@vue/compiler-core": "3.3.4", - "@vue/shared": "3.3.4", - "estree-walker": "^2.0.2", - "magic-string": "^0.30.0" + "@vue/shared": "3.4.14" } }, "@vue/runtime-core": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.4.tgz", - "integrity": "sha512-R+bqxMN6pWO7zGI4OMlmvePOdP2c93GsHFM/siJI7O2nxFRzj55pLwkpCedEY+bTMgp5miZ8CxfIZo3S+gFqvA==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.14.tgz", + "integrity": "sha512-qu+NMkfujCoZL6cfqK5NOfxgXJROSlP2ZPs4CTcVR+mLrwl4TtycF5Tgo0QupkdBL+2kigc6EsJlTcuuZC1NaQ==", "requires": { - "@vue/reactivity": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/reactivity": "3.4.14", + "@vue/shared": "3.4.14" } }, "@vue/runtime-dom": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.4.tgz", - "integrity": "sha512-Aj5bTJ3u5sFsUckRghsNjVTtxZQ1OyMWCr5dZRAPijF/0Vy4xEoRCwLyHXcj4D0UFbJ4lbx3gPTgg06K/GnPnQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.14.tgz", + "integrity": "sha512-B85XmcR4E7XsirEHVqhmy4HPbRT9WLFWV9Uhie3OapV9m1MEN9+Er6hmUIE6d8/l2sUygpK9RstFM2bmHEUigA==", "requires": { - "@vue/runtime-core": "3.3.4", - "@vue/shared": "3.3.4", - "csstype": "^3.1.1" + "@vue/runtime-core": "3.4.14", + "@vue/shared": "3.4.14", + "csstype": "^3.1.3" } }, "@vue/server-renderer": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.4.tgz", - "integrity": "sha512-Q6jDDzR23ViIb67v+vM1Dqntu+HUexQcsWKhhQa4ARVzxOY2HbC7QRW/ggkDBd5BU+uM1sV6XOAP0b216o34JQ==", + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.14.tgz", + "integrity": "sha512-pwSKXQfYdJBTpvWHGEYI+akDE18TXAiLcGn+Q/2Fj8wQSHWztoo7PSvfMNqu6NDhp309QXXbPFEGCU5p85HqkA==", "requires": { - "@vue/compiler-ssr": "3.3.4", - "@vue/shared": "3.3.4" + "@vue/compiler-ssr": "3.4.14", + "@vue/shared": "3.4.14" } }, "@vue/shared": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.4.tgz", - "integrity": "sha512-7OjdcV8vQ74eiz1TZLzZP4JwqM5fA94K6yntPS5Z25r9HDuGNzaGdgvwKYq6S+MxwF0TFRwe50fIR/MYnakdkQ==" + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.14.tgz", + "integrity": "sha512-nmi3BtLpvqXAWoRZ6HQ+pFJOHBU4UnH3vD3opgmwXac7vhaHKA9nj1VeGjMggdB9eLtW83eHyPCmOU1qzdsC7Q==" }, "1-minimal": { "version": "file:1-minimal", @@ -2468,28 +2593,54 @@ "3-minimal-with-verify": { "version": "file:3-minimal-with-verify", "requires": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "@types/express": "^4.17.17", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" + }, + "dependencies": { + "@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "requires": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + } } }, "4-minimal-with-webhook": { "version": "file:4-minimal-with-webhook", "requires": { - "@code-wallet/client": "^1.0.0", + "@code-wallet/client": "^1.3.1", "@types/express": "^4.17.17", "body-parser": "^1.20.2", "ejs": "^3.1.9", "express": "^4.18.2" + }, + "dependencies": { + "@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "requires": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + } } }, "5-example-purchase-flow": { "version": "file:5-example-purchase-flow", "requires": { - "@code-wallet/client": "^1.0.0", - "@code-wallet/library": "^1.0.0", + "@code-wallet/client": "^2.0.2", + "@code-wallet/library": "^1.3.1", "@markdoc/markdoc": "^0.3.2", "@types/body-parser": "^1.19.2", "@types/chance": "^1.1.4", @@ -2510,9 +2661,32 @@ } }, "6-minimal-with-login": { - "version": "file:6-minimal-with-login", + "version": "file:6-minimal-purchase-with-login", "requires": { - "@code-wallet/client": "^1.1.0", + "@code-wallet/client": "^1.3.1", + "@types/express": "^4.17.17", + "body-parser": "^1.20.2", + "ejs": "^3.1.9", + "express": "^4.18.2" + }, + "dependencies": { + "@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "requires": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + } + } + }, + "7-minimal-with-login": { + "version": "file:7-minimal-login", + "requires": { + "@code-wallet/client": "^2.0.6", "@types/express": "^4.17.17", "body-parser": "^1.20.2", "ejs": "^3.1.9", @@ -2529,14 +2703,14 @@ } }, "acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==" + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==" }, "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==" }, "ansi-styles": { "version": "4.3.0", @@ -2567,9 +2741,9 @@ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" }, "async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, "balanced-match": { "version": "1.0.2", @@ -2658,12 +2832,13 @@ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" } }, "chalk": { @@ -2738,9 +2913,9 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==" }, "csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "debug": { "version": "2.6.9", @@ -2750,6 +2925,16 @@ "ms": "2.0.0" } }, + "define-data-property": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", + "requires": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + } + }, "depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -2797,6 +2982,11 @@ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==" + }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -2955,19 +3145,19 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "glob": { @@ -2993,12 +3183,12 @@ "is-glob": "^4.0.1" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "requires": { - "function-bind": "^1.1.1" + "get-intrinsic": "^1.1.3" } }, "has-flag": { @@ -3006,6 +3196,14 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, + "has-property-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", + "requires": { + "get-intrinsic": "^1.2.2" + } + }, "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", @@ -3016,6 +3214,14 @@ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, + "hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "requires": { + "function-bind": "^1.1.2" + } + }, "http-errors": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", @@ -3071,12 +3277,12 @@ } }, "is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "is-extglob": { @@ -3112,9 +3318,9 @@ } }, "jose": { - "version": "4.14.6", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.14.6.tgz", - "integrity": "sha512-EqJPEUlZD0/CSUMubKtMaYUOtWe91tZXTWMJZoKSbLk+KtdhNdcvppH8lA9XwVu2V4Ailvsj0GBZJ2ZwDjfesQ==" + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", + "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==" }, "lodash": { "version": "4.17.21", @@ -3122,9 +3328,9 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", "requires": { "@jridgewell/sourcemap-codec": "^1.4.15" } @@ -3193,9 +3399,9 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" }, "nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==" + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==" }, "negotiator": { "version": "0.6.3", @@ -3209,9 +3415,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" }, "on-finished": { "version": "2.4.1", @@ -3264,11 +3470,11 @@ "dev": true }, "postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", + "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", "requires": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } @@ -3316,9 +3522,9 @@ } }, "resolve": { - "version": "1.22.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", - "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "requires": { "is-core-module": "^2.13.0", @@ -3383,6 +3589,18 @@ "send": "0.18.0" } }, + "set-function-length": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.0.tgz", + "integrity": "sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==", + "requires": { + "define-data-property": "^1.1.1", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.2", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + } + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -3471,9 +3689,9 @@ "dev": true }, "ts-node": { - "version": "10.9.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", - "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", "requires": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -3530,9 +3748,14 @@ } }, "typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==" + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==" + }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "unpipe": { "version": "1.0.0", @@ -3555,15 +3778,15 @@ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, "vue": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", - "integrity": "sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==", - "requires": { - "@vue/compiler-dom": "3.3.4", - "@vue/compiler-sfc": "3.3.4", - "@vue/runtime-dom": "3.3.4", - "@vue/server-renderer": "3.3.4", - "@vue/shared": "3.3.4" + "version": "3.4.14", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.14.tgz", + "integrity": "sha512-Rop5Al/ZcBbBz+KjPZaZDgHDX0kUP4duEzDbm+1o91uxYUNmJrZSBuegsNIJvUGy+epLevNRNhLjm08VKTgGyw==", + "requires": { + "@vue/compiler-dom": "3.4.14", + "@vue/compiler-sfc": "3.4.14", + "@vue/runtime-dom": "3.4.14", + "@vue/server-renderer": "3.4.14", + "@vue/shared": "3.4.14" } }, "wrappy": { diff --git a/package-lock.json b/package-lock.json index 03d3b22..cfc8d7b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3903,10 +3903,11 @@ }, "packages/client": { "name": "@code-wallet/client", - "version": "1.1.2", + "version": "2.0.2", "license": "MIT", "dependencies": { - "@code-wallet/library": "^1.1.1", + "@code-wallet/library": "^1.3.2", + "@code-wallet/rpc": "^1.3.1", "bs58": "^5.0.0", "buffer": "6.0.3" }, @@ -3922,13 +3923,13 @@ }, "packages/elements": { "name": "@code-wallet/elements", - "version": "1.1.3", + "version": "1.3.1", "license": "MIT", "dependencies": { - "@code-wallet/client": "^1.0.4", - "@code-wallet/events": "^1.0.0", - "@code-wallet/library": "^1.0.4", - "@code-wallet/rpc": "^1.0.0", + "@code-wallet/client": "^1.3.1", + "@code-wallet/events": "^1.3.1", + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", "@headlessui/vue": "^1.7.7", "@heroicons/vue": "^2.0.16" }, @@ -3949,6 +3950,17 @@ "vue": "^3.2.45" } }, + "packages/elements/node_modules/@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "dependencies": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, "packages/elements/node_modules/@types/node": { "version": "18.18.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz", @@ -3958,7 +3970,7 @@ }, "packages/events": { "name": "@code-wallet/events", - "version": "1.0.2", + "version": "1.3.1", "license": "MIT", "devDependencies": { "@types/chai": "^4.3.5", @@ -3972,10 +3984,10 @@ }, "packages/library": { "name": "@code-wallet/library", - "version": "1.2.1", + "version": "1.3.3", "license": "MIT", "dependencies": { - "@code-wallet/rpc": "^1.2.0", + "@code-wallet/rpc": "^1.3.1", "@noble/curves": "^1.2.0", "@noble/hashes": "^1.3.0", "bs58": "^5.0.0", @@ -4037,7 +4049,7 @@ }, "packages/rpc": { "name": "@code-wallet/rpc", - "version": "1.2.0", + "version": "1.3.1", "license": "MIT", "dependencies": { "@bufbuild/connect": "^0.8.6", @@ -4098,7 +4110,8 @@ "@code-wallet/client": { "version": "file:packages/client", "requires": { - "@code-wallet/library": "^1.1.1", + "@code-wallet/library": "^1.3.2", + "@code-wallet/rpc": "^1.3.1", "@types/chai": "^4.3.5", "@types/mocha": "^10.0.1", "@types/node": "^20.5.7", @@ -4113,10 +4126,10 @@ "@code-wallet/elements": { "version": "file:packages/elements", "requires": { - "@code-wallet/client": "^1.0.4", - "@code-wallet/events": "^1.0.0", - "@code-wallet/library": "^1.0.4", - "@code-wallet/rpc": "^1.0.0", + "@code-wallet/client": "^1.3.1", + "@code-wallet/events": "^1.3.1", + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", "@headlessui/vue": "^1.7.7", "@heroicons/vue": "^2.0.16", "@noble/hashes": "^1.3.2", @@ -4132,6 +4145,17 @@ "vite-plugin-dts": "^3.6.0" }, "dependencies": { + "@code-wallet/client": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@code-wallet/client/-/client-1.3.1.tgz", + "integrity": "sha512-4YDet8/fXXUevaRoxBsIHBP+MM9yVcrwT8OfccVXwIbWi+l9/o4/6EyRPve9rf6VTms9xy6qLZEN8b8/9ZTSMw==", + "requires": { + "@code-wallet/library": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", + "bs58": "^5.0.0", + "buffer": "6.0.3" + } + }, "@types/node": { "version": "18.18.0", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.0.tgz", @@ -4155,7 +4179,7 @@ "@code-wallet/library": { "version": "file:packages/library", "requires": { - "@code-wallet/rpc": "^1.2.0", + "@code-wallet/rpc": "^1.3.1", "@noble/curves": "^1.2.0", "@noble/hashes": "^1.3.0", "@types/chai": "^4.3.5", diff --git a/packages/client/package.json b/packages/client/package.json index 587e9e0..9f676e7 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/client", - "version": "1.1.2", + "version": "2.0.6", "license": "MIT", "repository": { "type": "git", @@ -14,15 +14,17 @@ "./dist/" ], "scripts": { - "test": "echo \"no tests yet\"", - "build": "tsc && tsc -p tsconfig.cjs.json" + "test": "TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\", \"target\": \"es2019\" }' ts-mocha --require esm './test/**/*.test.ts'", + "clean": "rm -rf dist", + "build": "npm run clean && tsc && tsc -p tsconfig.cjs.json" }, "browserslist": [ "supports bigint and not dead", "maintained node versions" ], "dependencies": { - "@code-wallet/library": "^1.1.1", + "@code-wallet/library": "^1.3.2", + "@code-wallet/rpc": "^1.3.1", "bs58": "^5.0.0", "buffer": "6.0.3" }, diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts new file mode 100644 index 0000000..00844f1 --- /dev/null +++ b/packages/client/src/client.ts @@ -0,0 +1,112 @@ +import * as proto from "@code-wallet/rpc"; +import { ErrInvalidResponse, ErrNetworkError } from "./errors"; + +export interface ClientOptions { + endpoint?: string, + fetch?: Function, +} + +/** + * Represents a connection to an endpoint with methods to perform HTTP requests. + */ +class Client { + endpoint: string; + fetch: any; + + /** + * Initializes a new connection to the provided endpoint. + * + * @param endpoint - The URL of the endpoint to connect to. + * @param fetch - Optional fetch function. Defaults to global fetch. + */ + constructor(endpoint: string, fetch: Function = globalThis.fetch) { + // The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+. + this.endpoint = endpoint; + + // Ensure that the fetch function is called with the right context and + // doesn't trigger "Illegal invocation". + this.fetch = (...args: any) => fetch.apply(globalThis, args); + } + + private getDecoder (method: T) { + return (data: Uint8Array) : InstanceType => { + return method.O.fromBinary(data) as InstanceType; + } + } + + private getEncoder (_: T){ + return (data: InstanceType) : Uint8Array => { + return data.toBinary(); + } + } + + private getSender (_: T) { + const url = `${this.endpoint}/api/`; + + return (payload: any): Promise => { + return new Promise(async (resolve, reject) => { + + try { + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/octet-stream', + }, + body: payload, + }); + + if (response.ok) { // Check if status code is in the range 200-299 + const buffer = await response.arrayBuffer(); + const envelope = proto.Common.Response.fromBinary(new Uint8Array(buffer)); + resolve(envelope); + } else { + reject(ErrInvalidResponse(response.status)); + } + } catch (error) { + reject(ErrNetworkError(error)); + } + }); + } + } + + private useService (service: T) { + const decode = this.getDecoder(service); + const encode = this.getEncoder(service); + const send = this.getSender(service); + + return { + decode, + encode, + send + }; + } + + private getServiceName(service: proto.ServiceType) { + return service.typeName.split(".").pop() as string; + } + + async send, M extends keyof S['methods']>( + service: S, + methodName: M & string, + request: proto.Request, + ): Promise> { + + const serviceName = this.getServiceName(service); + const { encode, decode, send } = this.useService(service.methods[methodName]); + + const payload = encode(request); + const req = new proto.Common.Request({ + service: serviceName, + method: methodName, + body: payload, + }); + + const envelope = await send(req.toBinary()); + const res = decode(envelope.body); + return res; + } +} + +export { + Client, +} \ No newline at end of file diff --git a/packages/client/src/connection.ts b/packages/client/src/connection.ts deleted file mode 100644 index 68e49f7..0000000 --- a/packages/client/src/connection.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { - ErrUnexpectedError, - ErrUnexpectedHttpStatus, - ErrUnexpectedServerError -} from "./errors"; - -/** - * Represents a connection to an endpoint with methods to perform HTTP requests. - */ -class Connection { - endpoint: string; - fetch: any; - - /** - * Initializes a new connection to the provided endpoint. - * - * @param endpoint - The URL of the endpoint to connect to. - * @param fetch - Optional fetch function. Defaults to global fetch. - */ - constructor(endpoint: string, fetch: Function = globalThis.fetch) { - // The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+. - this.endpoint = endpoint; - - // Ensure that the fetch function is called with the right context and - // doesn't trigger "Illegal invocation". - this.fetch = (...args: any) => fetch.apply(globalThis, args); - } - - /** - * Performs an HTTP GET request to the specified method with provided parameters. - * - * @param method - The API method to call. - * @param params - The parameters for the method. - * @returns The response JSON object on success. - * @throws Will throw an error if the HTTP status is not 200 or if the server returns an error. - */ - async get(method: string, params: any) { - const url = `${this.endpoint}/${method}?${new URLSearchParams(params)}`; - - const req = await this.fetch(url, { - method: 'GET', - headers: { 'Content-Type': 'application/json' } - }); - - if (req.status !== 200) { - const msg = await req.text(); - throw ErrUnexpectedHttpStatus(req.status, msg); - } - - const json = await req.json(); - if (json.error) { - throw ErrUnexpectedServerError(json.error); - } - - if (json.success) { - return json; - } - - console.error(json); - throw ErrUnexpectedError(); - } - - /** - * Performs an HTTP POST request to the specified method with provided body data. - * - * @param method - The API method to call. - * @param body - The data to be sent in the request body. - * @returns `true` on success. - * @throws Will throw an error if the HTTP status is not 200 or if the server returns an error. - */ - async post(method: string, body: any) { - const url = `${this.endpoint}/${method}`; - - const req = await this.fetch(url, { - method: 'POST', - body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json' } - }); - - if (req.status !== 200) { - const msg = await req.text(); - throw ErrUnexpectedHttpStatus(req.status, msg); - } - - const json = await req.json(); - if (json.error) { - throw ErrUnexpectedServerError(json.error); - } - - if (json.success) { - return true; - } - - console.error(json); - throw ErrUnexpectedError(); - } -} - -export { - Connection, -} \ No newline at end of file diff --git a/packages/client/src/errors.ts b/packages/client/src/errors.ts index 438400f..5b2a44c 100644 --- a/packages/client/src/errors.ts +++ b/packages/client/src/errors.ts @@ -1,9 +1,13 @@ const ErrUnexpectedError = () => new Error("unexpected error"); -const ErrUnexpectedHttpStatus = (val: any, msg: any) => new Error(`unexpected HTTP status: ${val}, ${msg}`); -const ErrUnexpectedServerError = (val: any) => new Error(`unexpected server error: ${val}`); +const ErrNetworkError = (error: any) => new Error(`Network error ${error}`); +const ErrInvalidResponse = (status:number) => new Error(`Request failed with status code ${status}`); +const ErrIntentIdRequired = () => new Error("intent ID is required"); +const ErrSignerRequired = () => new Error("signer is required"); export { ErrUnexpectedError, - ErrUnexpectedHttpStatus, - ErrUnexpectedServerError, + ErrIntentIdRequired, + ErrSignerRequired, + ErrNetworkError, + ErrInvalidResponse, }; diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 5f18e50..f7e3ca6 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,2 +1,2 @@ export * from './intents'; -export * from './connection'; \ No newline at end of file +export * from './client'; \ No newline at end of file diff --git a/packages/client/src/intents.ts b/packages/client/src/intents.ts deleted file mode 100644 index ccac236..0000000 --- a/packages/client/src/intents.ts +++ /dev/null @@ -1,95 +0,0 @@ -import bs58 from "bs58"; -import { Buffer } from "buffer"; -import { - IntentOptions, - PaymentRequestIntent, - PaymentRequestWithLoginIntent, - PaymentRequestOptions, - LoginRequestOptions, - WebhookParams, - Intent, -} from "@code-wallet/library"; -import { Connection } from "./connection"; - -const api = 'https://api.getcode.com/v1'; -const client = new Connection(api); - -/** - * Enumeration representing the possible states of a Payment Intent. - */ -enum PaymentIntentState { - Pending = 'pending', - Confirmed = 'confirmed', -} - -type CreatePaymentIntentOptions = PaymentRequestOptions & - IntentOptions & - Partial & - Partial; - -type GetStatusForIntentOptions = { intent: string }; - -interface IntentStatus { - status: PaymentIntentState, - user: string | undefined, -} - -/** - * Collection of methods related to handling payment intents. - */ -const paymentIntents = { - /** - * Creates a new payment intent. - * - * @param obj - The options for creating a payment intent. - * @returns An object containing the client secret and intent ID. - * @throws Will throw an error if unable to create the intent. - */ - create: async (obj: CreatePaymentIntentOptions) => { - obj.mode = 'payment'; - - let intent : Intent; - if (obj.login) { - intent = new PaymentRequestWithLoginIntent(obj); - } else { - intent = new PaymentRequestIntent(obj); - } - - const envelope = intent.sign(); - const body = { - intent: envelope.intent, - message: Buffer.from(envelope.message).toString('base64url'), - signature: bs58.encode(envelope.signature), - webhook: intent.options.webhook?.url, - } - - await client.post('createIntent', body); - - return { - clientSecret: intent.getClientSecret(), - id: intent.getIntentId(), - } - }, - - /** - * Retrieves the status of a specified payment intent. - * - * @param obj - The options containing the intent ID to check status for. - * @returns An object representing the intent's status. - * @throws Will throw an error if unable to retrieve the intent's status. - */ - getStatus: async (obj: GetStatusForIntentOptions) : Promise => { - const res = await client.get('getStatus', { intent: obj.intent }); - - let status = PaymentIntentState.Pending; - if (res.status === 'SUBMITTED') { - status = PaymentIntentState.Confirmed; - } - - return { status, user: res.user }; - } -} - -export { - paymentIntents, -} \ No newline at end of file diff --git a/packages/client/src/intents/index.ts b/packages/client/src/intents/index.ts new file mode 100644 index 0000000..f5b2d38 --- /dev/null +++ b/packages/client/src/intents/index.ts @@ -0,0 +1,13 @@ +import { loginIntents } from './login'; +import { paymentIntents } from './payments'; + +const getStatus = paymentIntents.getStatus; +const getUserId = loginIntents.getUserId; + +export { + getStatus, + getUserId, + + paymentIntents, + loginIntents, +}; \ No newline at end of file diff --git a/packages/client/src/intents/login.ts b/packages/client/src/intents/login.ts new file mode 100644 index 0000000..ae3c652 --- /dev/null +++ b/packages/client/src/intents/login.ts @@ -0,0 +1,86 @@ +import { + IntentOptions, + IntentSigners, + LoginRequestOptions, + WebhookParams, + LoginRequestIntent, +} from "@code-wallet/library"; + +import { useClient } from "../utils/useClient"; +import { createIntent } from "../utils/createIntent"; +import { + GetStatusForIntentRequest, + GetStatusForIntentOptions, +} from "../requests/getStatus"; + +import { GetUserIdOptions, GetUserIdRequest } from "../requests/getUserId"; +import { ClientOptions } from "../client"; + +/** + * Options for creating a login intent. + * + * Login attempts require a verifier, which is a public key that is used to + * verify the ownership of a domain. The verifier public key must be provided by + * the domain at the root level inside the /.well-known/code-payments.json file. + * + * Any intent can optionally be configured with a webhook. If a webhook is + * provided, the intent details will be sent to the webhook after it is + * confirmed. + */ +type CreateLoginIntentOptions = LoginRequestOptions & + IntentOptions & + IntentSigners & + Partial; + +/** + * Collection of methods related to handling payment intents. + */ +const loginIntents = { + + /** + * Creates a new login intent. + * + * @param opt - The options for creating a login intent. + * @returns An object containing the client secret and intent ID. + * @throws Will throw an error if unable to create the intent. + **/ + create: async (opt: CreateLoginIntentOptions & ClientOptions) => { + const client = useClient(opt); + const intent = new LoginRequestIntent(opt); + + return await createIntent(intent, client); + }, + + /** + * Retrieves the status of a specified payment intent. + * + * @param opt - The options containing the intent ID to check status for. + * @returns An object representing the intent's status. + * @throws Will throw an error if unable to retrieve the intent's status. + */ + getStatus: async (opt: GetStatusForIntentOptions & ClientOptions) => { + const client = useClient(opt); + + const req = new GetStatusForIntentRequest(opt); + return await req.send(client); + }, + + /** + * Retrieves the user ID associated with a login intent. + * + * @param opt - The options containing the intent ID and verifier to retrieve the user ID for. + * @returns An object containing the user ID if the verifier is valid and the intent is confirmed. + * @throws Will throw an error if unable to retrieve the user ID for the specified intent. + */ + getUserId: async (opt: GetUserIdOptions & ClientOptions) => { + const client = useClient(opt); + + const req = new GetUserIdRequest(opt); + return await req.send(client); + } +} + + +export { + loginIntents, +} diff --git a/packages/client/src/intents/payments.ts b/packages/client/src/intents/payments.ts new file mode 100644 index 0000000..422812a --- /dev/null +++ b/packages/client/src/intents/payments.ts @@ -0,0 +1,79 @@ +import { + IntentOptions, + IntentSigners, + PaymentRequestIntent, + PaymentRequestWithLoginIntent, + PaymentRequestOptions, + LoginRequestOptions, + WebhookParams, + Intent, +} from "@code-wallet/library"; + +import { useClient } from "../utils/useClient"; +import { createIntent } from "../utils/createIntent"; +import { + GetStatusForIntentRequest, + GetStatusForIntentOptions +} from "../requests/getStatus"; +import { ClientOptions } from "../client"; + +/** + * Options for creating a payment intent. + * + * Payments can optionally be made with a login request. If a login request is + * provided, the user id can be retrieved from the intent after it is confirmed. + * + * Any intent can optionally be configured with a webhook. If a webhook is + * provided, the intent details will be sent to the webhook after it is + * confirmed. + */ +type CreatePaymentIntentOptions = PaymentRequestOptions & + IntentOptions & + Partial & + Partial & + Partial & + Partial; + +/** + * Collection of methods related to handling payment intents. + */ +const paymentIntents = { + + /** + * Creates a new payment intent. + * + * @param opt - The options for creating a payment intent. + * @returns An object containing the client secret and intent ID. + * @throws Will throw an error if unable to create the intent. + */ + create: async (opt: CreatePaymentIntentOptions & ClientOptions) => { + const connection = useClient(opt); + + let intent : Intent; + if (opt.login) { + intent = new PaymentRequestWithLoginIntent(opt); + } else { + intent = new PaymentRequestIntent(opt); + } + + return await createIntent(intent, connection); + }, + + /** + * Retrieves the status of a specified payment intent. + * + * @param opt - The options containing the intent ID to check status for. + * @returns An object representing the intent's status. + * @throws Will throw an error if unable to retrieve the intent's status. + */ + getStatus: async (opt: GetStatusForIntentOptions & ClientOptions) => { + const connection = useClient(opt); + + const req = new GetStatusForIntentRequest(opt); + return await req.send(connection); + } +} + +export { + paymentIntents, +} diff --git a/packages/client/src/request.ts b/packages/client/src/request.ts new file mode 100644 index 0000000..40c7cb2 --- /dev/null +++ b/packages/client/src/request.ts @@ -0,0 +1,37 @@ +import * as proto from '@code-wallet/rpc'; +import { Client } from './client'; + +/** + * An interface for making a request to the Code Sequencer. Most requests + * require a signed proto message, this provides a common interface. + */ +export interface CodeRequest { + /** + * Validate the details of this request, and throw an error if they're invalid. + */ + validate(): void; + + /** + * Serialize this request into a minimal message for sending to the Code Sequencer. + */ + toProto(): proto.AnyMessage; + + /** + * Sign this request with the given signers. + * + * @returns A signature for this request + */ + sign(): { + envelope: proto.AnyMessage; + signedBytes: Uint8Array; + signature: Uint8Array; + } | undefined; + + /** + * Submit this request to the Code Sequencer. + * + * @param client - The connection to the Code Sequencer. + */ + send(client: Client): Promise; +} + \ No newline at end of file diff --git a/packages/client/src/requests/getStatus.ts b/packages/client/src/requests/getStatus.ts new file mode 100644 index 0000000..9d77781 --- /dev/null +++ b/packages/client/src/requests/getStatus.ts @@ -0,0 +1,85 @@ +import * as proto from "@code-wallet/rpc"; +import { PublicKey, } from "@code-wallet/library"; +import { CodeRequest } from "../request"; +import { Client } from "../client"; + +/** + * Enumeration representing the possible states of a Payment Intent. + */ +export enum IntentState { + Pending = 'pending', + Confirmed = 'confirmed', +} + +export interface IntentStatus { + status: IntentState, + exists: boolean, + intentSubmitted: boolean, + codeScanned: boolean, +} + +export type GetStatusForIntentOptions = { + intent: string, +}; + +/** + * GetStatusForIntent is a request to retrieve the status of a specified intent. + * + * This is useful in the case that a browser or client fails to let your server + * know about the success of an intent. A webhook is recommended but you can use + * this in lieu of one. + * + * @throws Will throw an error if the intent ID is not provided. + */ +class GetStatusForIntentRequest implements CodeRequest { + readonly intentId : string; + + constructor(opts: GetStatusForIntentOptions) { + this.intentId = opts.intent; + this.validate(); + } + + validate() { + if (!this.intentId) { + throw new Error('Intent ID is required'); + } + } + + toProto() { + const intentId = PublicKey.fromBase58(this.intentId); + + return new proto.GetStatusRequest({ + intentId: { + value: intentId.toBuffer(), + }, + }); + } + + sign() { + // This request doesn't need to be signed. + return undefined; + } + + async send(client: Client) : Promise { + const res = await client.send(proto.MicroPayment, 'getStatus', this.toProto()); + + let status = IntentState.Pending; + if (res.intentSubmitted) { + status = IntentState.Confirmed; + } + + const { exists, codeScanned, intentSubmitted } = res; + + return { + status, + exists, + codeScanned, + intentSubmitted, + }; + } +} + + +export { + GetStatusForIntentRequest, +} \ No newline at end of file diff --git a/packages/client/src/requests/getUserId.ts b/packages/client/src/requests/getUserId.ts new file mode 100644 index 0000000..da61241 --- /dev/null +++ b/packages/client/src/requests/getUserId.ts @@ -0,0 +1,91 @@ +import * as proto from "@code-wallet/rpc"; +import { Keypair, PublicKey, } from "@code-wallet/library"; +import { CodeRequest, } from "../request"; +import { Client } from "../client"; +import { ErrSignerRequired } from "../errors"; + +export type GetUserIdOptions = { + intent: string, + verifier: Keypair, +}; + +export type GetUserIdResponse = { + userId: string | undefined, +}; + +/** + * GetUserId is a request to retrieve the user ID associated with a third party + * app after a login intent has been confirmed. + * + * @throws Will throw an error if the intent ID is not provided. + */ +class GetUserIdRequest implements CodeRequest { + readonly intentId : string; + readonly signer : Keypair; + + constructor(opts: GetUserIdOptions) { + this.intentId = opts.intent; + this.signer = opts.verifier; + + this.validate(); + } + + validate() { + if (!this.intentId) { + return ErrSignerRequired(); + } + if (!this.signer || !this.signer.sign) { + return ErrSignerRequired(); + } + } + + toProto() { + const intentId = PublicKey.fromBase58(this.intentId); + const verifier = this.signer.getPublicKey(); + + return new proto.GetLoginForThirdPartyAppRequest({ + intentId: { + value: intentId.toBuffer(), + }, + verifier: { + value: verifier.toBuffer(), + } + }); + } + + sign() { + const msg = this.toProto(); + const sig = this.signer.sign(msg.toBinary()); + + // Add the signature to the message. + msg.signature = new proto.Common.Signature({ + value: sig, + }); + + return { + envelope: msg, + signedBytes: msg.toBinary(), + signature: sig, + } + } + + async send(client: Client) { + const { envelope } = this.sign(); + const res = await client.send(proto.Identity, 'getLoginForThirdPartyApp', envelope); + + let userId : string | undefined; + if (res.userId) { + const user = new PublicKey(res.userId.value); + userId = user.toBase58(); + } + + return { + userId, + }; + } +} + + +export { + GetUserIdRequest, +} diff --git a/packages/client/src/requests/index.ts b/packages/client/src/requests/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/client/src/utils/createIntent.ts b/packages/client/src/utils/createIntent.ts new file mode 100644 index 0000000..8e29041 --- /dev/null +++ b/packages/client/src/utils/createIntent.ts @@ -0,0 +1,22 @@ +import { Client } from "../client"; +import { Intent, } from "@code-wallet/library"; +import * as proto from "@code-wallet/rpc"; +import { ErrUnexpectedError } from "../errors"; + +async function createIntent(intent: Intent, client: Client) { + const msg = await intent.getSendMessageRequestProto() + const res = await client.send(proto.Messaging, 'sendMessage', msg); + + if (res.result !== proto.SendMessageResponse_Result.OK) { + ErrUnexpectedError(); + } + + return { + clientSecret: intent.getClientSecret(), + id: intent.getIntentId(), + }; +} + +export { + createIntent, +} diff --git a/packages/client/src/utils/useClient.ts b/packages/client/src/utils/useClient.ts new file mode 100644 index 0000000..239e2e9 --- /dev/null +++ b/packages/client/src/utils/useClient.ts @@ -0,0 +1,9 @@ +import { Client, ClientOptions } from "../client"; + +const defaultEndpoint = 'https://cash.getcode.com/v1'; + +export function useClient(opt: ClientOptions = {}) : Client { + const endpoint = opt.endpoint ?? defaultEndpoint; + + return new Client(endpoint, opt.fetch); +} \ No newline at end of file diff --git a/packages/client/test/client.test.ts b/packages/client/test/client.test.ts new file mode 100644 index 0000000..c9500fe --- /dev/null +++ b/packages/client/test/client.test.ts @@ -0,0 +1,54 @@ +import * as proto from "@code-wallet/rpc"; +import * as client from "../src/"; + +import { Client } from "../src/"; +import { PublicKey } from "@code-wallet/library"; +import { expect } from 'chai'; + +describe('Low level client', () => { + + it('test low level getStatus api message', async () => { + const intentId = PublicKey.fromBase58('9sK9x3MC7yEMzfA5VRRcu2P72gCGGsF1htpeAMXae9bz') + const msg = new proto.GetStatusRequest({ + intentId: { + value: intentId.toBuffer(), + } + }) + + const api = new Client('https://cash.getcode.com/v1'); + const res = await api.send(proto.MicroPayment, 'getStatus', msg); + + expect(res).to.not.be.undefined; + expect(res.exists).to.be.true; + expect(res.codeScanned).to.be.true; + expect(res.intentSubmitted).to.be.true; + }); +}); + +describe('High level client', () => { + + it('test high level getStatus api message', async () => { + const res = await client.getStatus({ + intent: '9sK9x3MC7yEMzfA5VRRcu2P72gCGGsF1htpeAMXae9bz', + }); + + expect(res).to.not.be.undefined; + expect(res.exists).to.be.true; + expect(res.codeScanned).to.be.true; + expect(res.intentSubmitted).to.be.true; + }); + + it('test high level create payment intent api message', async () => { + const res = await client.paymentIntents.create({ + mode: 'payment', + amount: 100, + currency: 'usd', + destination: '9sK9x3MC7yEMzfA5VRRcu2P72gCGGsF1htpeAMXae9bz', + }); + + expect(res).to.not.be.undefined; + expect(res.clientSecret).to.not.be.undefined; + expect(res.id).to.not.be.undefined; + }); + +}); \ No newline at end of file diff --git a/packages/elements/package.json b/packages/elements/package.json index 308086a..83e0be7 100644 --- a/packages/elements/package.json +++ b/packages/elements/package.json @@ -1,6 +1,6 @@ { "name": "@code-wallet/elements", - "version": "1.1.3", + "version": "1.3.1", "license": "MIT", "repository": { "type": "git", @@ -25,10 +25,10 @@ "maintained node versions" ], "dependencies": { - "@code-wallet/events": "^1.0.0", - "@code-wallet/library": "^1.0.4", - "@code-wallet/client": "^1.0.4", - "@code-wallet/rpc": "^1.0.0", + "@code-wallet/events": "^1.3.1", + "@code-wallet/library": "^1.3.1", + "@code-wallet/client": "^1.3.1", + "@code-wallet/rpc": "^1.3.1", "@headlessui/vue": "^1.7.7", "@heroicons/vue": "^2.0.16" }, diff --git a/packages/elements/src/components/elements/PaymentRequestButton.vue b/packages/elements/src/components/elements/IntentRequestButton.vue similarity index 93% rename from packages/elements/src/components/elements/PaymentRequestButton.vue rename to packages/elements/src/components/elements/IntentRequestButton.vue index bea5cd0..53c9fef 100644 --- a/packages/elements/src/components/elements/PaymentRequestButton.vue +++ b/packages/elements/src/components/elements/IntentRequestButton.vue @@ -6,6 +6,7 @@ const config = useConfig(); const options = inject('options'); + const mode = options?.mode ?? 'payment'; const emit = defineEmits<{ resize: [{ width: number, height: number }]; @@ -13,7 +14,10 @@ }>(); const channel = new EventChannel(); - const url = `${config.codeSdk()}/payment-request-button/#/${channel.id}/p=${encode(options)}`; + const url = `${config.codeSdk()}/${mode}-request-button/#/${channel.id}/p=${encode(options)}`; + + console.log('url', url); + const el = ref(null); const frameWidth = ref(0); const frameHeight = ref(0); diff --git a/packages/elements/src/components/elements/PaymentRequestModalDesktop.vue b/packages/elements/src/components/elements/IntentRequestModalDesktop.vue similarity index 95% rename from packages/elements/src/components/elements/PaymentRequestModalDesktop.vue rename to packages/elements/src/components/elements/IntentRequestModalDesktop.vue index 20c1481..a9311b0 100644 --- a/packages/elements/src/components/elements/PaymentRequestModalDesktop.vue +++ b/packages/elements/src/components/elements/IntentRequestModalDesktop.vue @@ -6,6 +6,7 @@ const config = useConfig(); const options = inject('options'); + const mode = options?.mode ?? 'payment'; const emit = defineEmits([ 'codeScanned', @@ -18,9 +19,11 @@ ]); const channel = new EventChannel(); - const url = `${config.codeSdk()}/payment-request-modal-desktop/#/${channel.id}/p=${encode(options)}`; + const url = `${config.codeSdk()}/${mode}-request-modal-desktop/#/${channel.id}/p=${encode(options)}`; const el = ref(null); + console.log('url', url); + channel.on('codeScanned' , () => { emit('codeScanned'); }); diff --git a/packages/elements/src/components/elements/PaymentRequestModalMobile.vue b/packages/elements/src/components/elements/IntentRequestModalMobile.vue similarity index 96% rename from packages/elements/src/components/elements/PaymentRequestModalMobile.vue rename to packages/elements/src/components/elements/IntentRequestModalMobile.vue index c893393..e4618ec 100644 --- a/packages/elements/src/components/elements/PaymentRequestModalMobile.vue +++ b/packages/elements/src/components/elements/IntentRequestModalMobile.vue @@ -6,6 +6,7 @@ const config = useConfig(); const options = inject('options'); + const mode = options?.mode ?? 'payment'; const emit = defineEmits([ 'codeScanned', @@ -18,7 +19,7 @@ ]); const channel = new EventChannel(); - const url = `${config.codeSdk()}/payment-request-modal-mobile/#/${channel.id}/p=${encode(options)}`; + const url = `${config.codeSdk()}/${mode}-request-modal-mobile/#/${channel.id}/p=${encode(options)}`; const el = ref(null); channel.on('codeScanned' , () => { diff --git a/packages/elements/src/components/elements/index.ts b/packages/elements/src/components/elements/index.ts index 8f722e3..45b4c03 100644 --- a/packages/elements/src/components/elements/index.ts +++ b/packages/elements/src/components/elements/index.ts @@ -1,3 +1,3 @@ -export { default as PaymentRequestButton } from './PaymentRequestButton.vue' -export { default as PaymentRequestModalDesktop } from './PaymentRequestModalDesktop.vue' -export { default as PaymentRequestModalMobile } from './PaymentRequestModalMobile.vue' \ No newline at end of file +export { default as IntentRequestButton } from './IntentRequestButton.vue' +export { default as IntentRequestModalDesktop } from './IntentRequestModalDesktop.vue' +export { default as IntentRequestModalMobile } from './IntentRequestModalMobile.vue' \ No newline at end of file diff --git a/packages/elements/src/components/flows/ButtonFlow.vue b/packages/elements/src/components/flows/ButtonFlow.vue index fea15c0..cec4ddd 100644 --- a/packages/elements/src/components/flows/ButtonFlow.vue +++ b/packages/elements/src/components/flows/ButtonFlow.vue @@ -1,17 +1,17 @@