From fd54c4f93d455000f0c9d1fcdbe1713559b4200b Mon Sep 17 00:00:00 2001 From: ennucore Date: Wed, 4 Jan 2023 15:43:50 +0100 Subject: [PATCH] Required collections + started implementing login --- .idea/workspace.xml | 36 +++++-- package-lock.json | 174 +++++++++++++++++++++++++++++++- package.json | 4 +- public/tonconnect-manifest.json | 5 + src/collection.ts | 11 ++ src/components/DarkLayout.vue | 6 +- src/components/DomainResult.vue | 1 + src/components/GetDomainBtn.vue | 21 +++- src/components/Header.vue | 28 +++-- src/components/LoginModal.vue | 114 +++++++++++++++++++++ src/components/ZoneTable.vue | 16 ++- src/result.ts | 32 +++++- src/zone.ts | 6 +- 13 files changed, 427 insertions(+), 27 deletions(-) create mode 100644 public/tonconnect-manifest.json create mode 100644 src/collection.ts create mode 100644 src/components/LoginModal.vue diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ebe5cce..3cca76c 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,14 +1,20 @@ - + + + + - - - + + + + + + - - + + @@ -220,6 +237,7 @@ - \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 2af726e..ba6e572 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@popperjs/core": "^2.11.6", + "@tonconnect/sdk": "^2.0.4", "axios": "^1.2.1", "bulma": "^0.9.4", "qr-code-styling": "^1.6.0-rc.1", @@ -16,7 +17,8 @@ "vue": "^3.2.45", "vue-contenteditable": "^4.1.0", "vue-router": "^4.1.6", - "vue3-popper": "^1.5.0" + "vue3-popper": "^1.5.0", + "vuex": "^4.0.2" }, "devDependencies": { "@types/node": "^18.11.16", @@ -499,6 +501,26 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@tonconnect/protocol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.0.1.tgz", + "integrity": "sha512-jkSj6EKjIlHnJxrtxdlO7KqVJe41yrIgqamGZiqziKH6iwx0m9YyKvuIREd6CmWY2jbsev3BvBWqPp9KH6HrRw==", + "dependencies": { + "tweetnacl-util": "^0.15.1" + } + }, + "node_modules/@tonconnect/sdk": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-2.0.4.tgz", + "integrity": "sha512-mG3vm0F6aNxAw5QNEeZ1MH0i3yWpGWxpZauFZTuy2wo2yKZscoAYYBlEF0AUwmdClW6n458EYrXFuC7Vy/a8FA==", + "dependencies": { + "@tonconnect/protocol": "^2.0.1", + "deepmerge": "^4.2.2", + "eventsource": "^2.0.2", + "node-fetch": "^2.6.7", + "tweetnacl": "^1.0.3" + } + }, "node_modules/@types/node": { "version": "18.11.16", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", @@ -1008,6 +1030,14 @@ "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/define-properties": { "version": "1.1.4", "dev": true, @@ -1175,6 +1205,14 @@ "node": ">=0.8.0" } }, + "node_modules/eventsource": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz", + "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==", + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -1789,6 +1827,25 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -2559,6 +2616,21 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + }, "node_modules/typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", @@ -2742,6 +2814,31 @@ "vue": "^3.2.20" } }, + "node_modules/vuex": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz", + "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", + "dependencies": { + "@vue/devtools-api": "^6.0.0-beta.11" + }, + "peerDependencies": { + "vue": "^3.0.2" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which-boxed-primitive": { "version": "1.0.2", "dev": true, @@ -3016,6 +3113,26 @@ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.6.tgz", "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==" }, + "@tonconnect/protocol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.0.1.tgz", + "integrity": "sha512-jkSj6EKjIlHnJxrtxdlO7KqVJe41yrIgqamGZiqziKH6iwx0m9YyKvuIREd6CmWY2jbsev3BvBWqPp9KH6HrRw==", + "requires": { + "tweetnacl-util": "^0.15.1" + } + }, + "@tonconnect/sdk": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-2.0.4.tgz", + "integrity": "sha512-mG3vm0F6aNxAw5QNEeZ1MH0i3yWpGWxpZauFZTuy2wo2yKZscoAYYBlEF0AUwmdClW6n458EYrXFuC7Vy/a8FA==", + "requires": { + "@tonconnect/protocol": "^2.0.1", + "deepmerge": "^4.2.2", + "eventsource": "^2.0.2", + "node-fetch": "^2.6.7", + "tweetnacl": "^1.0.3" + } + }, "@types/node": { "version": "18.11.16", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.16.tgz", @@ -3445,6 +3562,11 @@ "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==" }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + }, "define-properties": { "version": "1.1.4", "dev": true, @@ -3567,6 +3689,11 @@ "version": "1.0.5", "dev": true }, + "eventsource": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz", + "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==" + }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", @@ -3959,6 +4086,14 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -4470,6 +4605,21 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + }, + "tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==" + }, "typescript": { "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", @@ -4581,6 +4731,28 @@ "debounce": "^1.2.1" } }, + "vuex": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-4.0.2.tgz", + "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", + "requires": { + "@vue/devtools-api": "^6.0.0-beta.11" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which-boxed-primitive": { "version": "1.0.2", "dev": true, diff --git a/package.json b/package.json index 26ac2fc..87d591a 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@popperjs/core": "^2.11.6", + "@tonconnect/sdk": "^2.0.4", "axios": "^1.2.1", "bulma": "^0.9.4", "qr-code-styling": "^1.6.0-rc.1", @@ -18,7 +19,8 @@ "vue": "^3.2.45", "vue-contenteditable": "^4.1.0", "vue-router": "^4.1.6", - "vue3-popper": "^1.5.0" + "vue3-popper": "^1.5.0", + "vuex": "^4.0.2" }, "devDependencies": { "@types/node": "^18.11.16", diff --git a/public/tonconnect-manifest.json b/public/tonconnect-manifest.json new file mode 100644 index 0000000..1aff0da --- /dev/null +++ b/public/tonconnect-manifest.json @@ -0,0 +1,5 @@ +{ + "url": "https://agorata.io/", + "name": "Agorata", + "iconUrl": "https://front.agorata.io/favicon.png" +} diff --git a/src/collection.ts b/src/collection.ts new file mode 100644 index 0000000..50d79f9 --- /dev/null +++ b/src/collection.ts @@ -0,0 +1,11 @@ +export class Collection { + address: string; + name: string; + logo_url?: string; + + constructor(address: string, name: string, logo_url?: string) { + this.address = address; + this.name = name; + this.logo_url = logo_url; + } +} diff --git a/src/components/DarkLayout.vue b/src/components/DarkLayout.vue index 7335fc6..403a079 100644 --- a/src/components/DarkLayout.vue +++ b/src/components/DarkLayout.vue @@ -1,6 +1,6 @@ diff --git a/src/components/DomainResult.vue b/src/components/DomainResult.vue index d3e0209..01124a1 100644 --- a/src/components/DomainResult.vue +++ b/src/components/DomainResult.vue @@ -4,6 +4,7 @@
Get
-

{{domain}}

+

{{ domain }}

for
- {{price}} + {{ price }} TON +
@@ -22,6 +29,10 @@ export default { type: Number, required: true }, + collection_required: { + // type: Collection | null, + default: null + } } } @@ -70,4 +81,10 @@ export default { height: 2rem; margin-left: -0.3rem; } + +.collection { + border-radius: 10px; + background-color: white; + color: #0088cc; +} \ No newline at end of file diff --git a/src/components/Header.vue b/src/components/Header.vue index 9922bf1..382bd2f 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -1,12 +1,20 @@