@@ -34,7 +37,3 @@ defineProps<{
disabled?: boolean
}>()
-
-
diff --git a/libs/ui/src/components/NeoDropdown/NeoDropdown.scss b/libs/ui/src/components/NeoDropdown/NeoDropdown.scss
index 97f8f2c645..9ba7345b53 100644
--- a/libs/ui/src/components/NeoDropdown/NeoDropdown.scss
+++ b/libs/ui/src/components/NeoDropdown/NeoDropdown.scss
@@ -2,55 +2,41 @@
@import '@oruga-ui/oruga-next/src/scss/utilities/_variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_animations.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_helpers.scss';
-@import '../../scss/variable.scss';
$dropdown-menu-padding: 0;
$dropdown-menu-margin: 1rem 0;
$dropdown-menu-border-radius: 0;
-$dropdown-menu-box-shadow: 4px 4px hsl(0deg, 0%, 4%);
-$dropdown-item-hover-color: #1f1f1f;
-$dropdown-item-hover-background-color: #ffe5f3;
+$dropdown-menu-box-shadow: var(--primary-shadow);
+$dropdown-menu-background: var(--background-color);
+$dropdown-item-color: var(--text-color);
+$dropdown-item-hover-color: var(--text-color);
+$dropdown-item-hover-background-color: var(--k-accent-hover);
@import '@oruga-ui/oruga-next/src/scss/components/_dropdown.scss';
.o-drop__item {
- @include ktheme() {
- border-bottom: 1px solid theme('border-color');
- color: theme('text-color')!important;
- }
-
- &:hover {
- @include ktheme() {
- background: theme('k-accentHover');
- }
- }
+ @apply border-b border-b-border-color;
&.is-active,
&--active,
&[active='true'] {
- @include ktheme() {
- color: theme('text-color-inverse') !important;
- background: theme('background-color-inverse') !important;
+ @apply text-text-color-inverse bg-background-color-inverse;
+
+ &:hover {
+ @apply text-text-color-inverse bg-background-color-inverse;
}
}
.o-tip {
- width: 100%;
+ @apply w-full;
}
}
.o-drop__menu {
- @include ktheme() {
- box-shadow: theme('primary-shadow');
- border: 1px solid theme('border-color');
- color: theme('text-color');
- background: theme('background-color');
- }
+ @apply border-default border-border-color text-text-color;
&.no-shadow {
- box-shadow: none !important;
+ @apply shadow-none;
}
-
}
-
diff --git a/libs/ui/src/components/NeoDropdown/NeoDropdownItem.vue b/libs/ui/src/components/NeoDropdown/NeoDropdownItem.vue
index 85e3ed691f..45e376c7a4 100644
--- a/libs/ui/src/components/NeoDropdown/NeoDropdownItem.vue
+++ b/libs/ui/src/components/NeoDropdown/NeoDropdownItem.vue
@@ -12,10 +12,6 @@ export default {
[this.computedClass('itemDisabledClass', 'o-drop__item--disabled')]:
this.parent.disabled || this.disabled,
},
- // {
- // [this.computedClass('itemActiveClass', 'o-drop__item--active')]:
- // this.isActive,
- // },
]
},
},
diff --git a/libs/ui/src/components/NeoIcon/NeoIcon.scss b/libs/ui/src/components/NeoIcon/NeoIcon.scss
index fee8a8b498..c2df5c3e79 100644
--- a/libs/ui/src/components/NeoIcon/NeoIcon.scss
+++ b/libs/ui/src/components/NeoIcon/NeoIcon.scss
@@ -1,5 +1,3 @@
-@import '../../scss/theme';
-
@import '@oruga-ui/oruga-next/src/scss/utilities/_expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/_animations.scss';
@@ -7,26 +5,17 @@
@import '@oruga-ui/oruga-next/src/scss/components/_icon.scss';
.o-icon--success {
- @include ktheme() {
- color: theme('k-green');
- }
+ @apply text-k-green;
}
+
.o-icon--primary {
- @include ktheme() {
- color: theme('k-primary');
- }
+ @apply text-k-primary;
}
.o-icon--k-grey {
- @include ktheme() {
- color: theme('k-grey');
- }
+ @apply text-k-grey;
}
-
.o-icon--spin {
- animation-name: icon-spin;
- animation-iteration-count: infinite;
- animation-timing-function: linear;
- animation-duration: var(--oruga-icon-spin-duration, 1.5s)
-}
\ No newline at end of file
+ @apply animate-icon-spin;
+}
diff --git a/libs/ui/src/components/NeoInput/NeoField.scss b/libs/ui/src/components/NeoInput/NeoField.scss
index 17e2ea203d..0d6e41d504 100644
--- a/libs/ui/src/components/NeoInput/NeoField.scss
+++ b/libs/ui/src/components/NeoInput/NeoField.scss
@@ -1,5 +1,3 @@
-@import '../../scss/variable.scss';
-@import '../../scss/theme.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/animations.scss';
@@ -12,39 +10,30 @@ $field-label-font-weight: 700;
.o-field {
&--error .o-input {
- @include ktheme() {
- border-color: theme('k-red') !important;
- }
+ @apply border-k-red;
+
&::placeholder {
- @include ktheme() {
- color: theme('k-red') !important;
- }
+ @apply text-k-red;
}
}
.o-field__label {
- margin-bottom: 0.75rem;
- @include ktheme() {
- color: theme('text-color');
- }
+ @apply mb-3 text-text-color;
}
&.o-field--focused {
input,
textarea {
- outline: none;
+ @apply outline-none;
}
}
.o-field__message-danger {
- @include ktheme() {
- color: theme('k-red');
- }
+ @apply text-k-red;
}
.o-field--addons > :not(:first-child):not(:last-child) button,
.o-field--addons > button:not(:first-child):not(:last-child) {
- border-right: 0;
- border-left: 0;
+ @apply border-l-0 border-r-0;
}
}
diff --git a/libs/ui/src/components/NeoInput/NeoInput.scss b/libs/ui/src/components/NeoInput/NeoInput.scss
index 95d5088bff..c9d5ccfae9 100644
--- a/libs/ui/src/components/NeoInput/NeoInput.scss
+++ b/libs/ui/src/components/NeoInput/NeoInput.scss
@@ -1,5 +1,3 @@
-@import '../../scss/variable.scss';
-@import '../../scss/theme.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/animations.scss';
@@ -14,25 +12,17 @@ $input-textarea-padding: 0.75rem 1rem;
.neo-input {
.o-input {
- outline: none;
- box-shadow: none;
- @include ktheme() {
- border: 1px solid theme('k-grey-fix');
- background-color: theme('background-color');
- color: theme('text-color');
+ @apply outline-none shadow-none border-default border-k-grey-fix bg-background-color text-text-color;
- &:focus {
- border: 1px solid theme('text-color');
- }
+ &:focus {
+ @apply border-default border-text-color;
}
&--danger {
- @include ktheme() {
- border: 1px solid theme('k-red');
+ @apply border-default border-k-red;
- &:focus {
- border: 1px solid theme('k-red');
- }
+ &:focus {
+ @apply border-default border-k-red;
}
}
}
diff --git a/libs/ui/src/components/NeoInputitems/NeoInputitems.scss b/libs/ui/src/components/NeoInputitems/NeoInputitems.scss
index a02e97f674..b1d4510a8f 100644
--- a/libs/ui/src/components/NeoInputitems/NeoInputitems.scss
+++ b/libs/ui/src/components/NeoInputitems/NeoInputitems.scss
@@ -13,38 +13,24 @@ $autocomplete-menu-border-radius: 0;
@import '@oruga-ui/oruga-next/src/scss/components/inputitems.scss';
.o-inputit__container {
- padding-top: 0;
- @include ktheme() {
- background-color: theme('background-color');
- }
+ @apply pt-0 bg-background-color;
+
.o-input.neo-input {
- outline: none;
- box-shadow: none;
- @include ktheme() {
- border: 1px solid theme('k-grey-fix');
- background-color: theme('background-color');
- color: theme('text-color');
-
- &:focus {
- border: 1px solid theme('text-color');
- }
+ @apply outline-none shadow-none border-default border-k-grey-fix bg-background-color text-text-color;
+
+ &:focus {
+ @apply border-text-color;
}
}
.o-acp__menu {
- width: 100% !important;
- @include ktheme() {
- box-shadow: theme('primary-shadow');
- border: 1px solid theme('border-color');
- background: theme('background-color');
- }
+ @apply w-full shadow-primary border-default border-border-color bg-background-color;
.o-acp__item {
- color: inherit;
+ @apply text-inherit;
+
&:hover {
- @include ktheme() {
- color: theme('k-hovergrey');
- }
+ @apply text-k-hover-grey;
}
}
}
diff --git a/libs/ui/src/components/NeoLoading/NeoLoading.scss b/libs/ui/src/components/NeoLoading/NeoLoading.scss
index ccd948fb36..77ec705f8e 100644
--- a/libs/ui/src/components/NeoLoading/NeoLoading.scss
+++ b/libs/ui/src/components/NeoLoading/NeoLoading.scss
@@ -1,13 +1,8 @@
-@import '../../scss/theme';
@import '@oruga-ui/oruga-next/src/scss/utilities/expressions.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/variables.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/animations.scss';
@import '@oruga-ui/oruga-next/src/scss/utilities/helpers.scss';
-@import '../../scss/variable.scss';
+$loading-overlay: rgb(0 0 0 / 0.5);
@import '@oruga-ui/oruga-next/src/scss/components/loading.scss';
-
-.o-load__overlay {
- background-color: rgba(0, 0, 0, 0.5);
-}
diff --git a/libs/ui/src/components/NeoLoading/NeoLoading.story.vue b/libs/ui/src/components/NeoLoading/NeoLoading.story.vue
index e3cccac322..f875fe5215 100644
--- a/libs/ui/src/components/NeoLoading/NeoLoading.story.vue
+++ b/libs/ui/src/components/NeoLoading/NeoLoading.story.vue
@@ -1,7 +1,7 @@
- Neo Loader
+
diff --git a/libs/ui/src/components/NeoLoading/NeoLoading.vue b/libs/ui/src/components/NeoLoading/NeoLoading.vue
index b0f791a4af..8bc75d0dd3 100644
--- a/libs/ui/src/components/NeoLoading/NeoLoading.vue
+++ b/libs/ui/src/components/NeoLoading/NeoLoading.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/libs/ui/src/components/NeoSwitch/NeoSwitch.scss b/libs/ui/src/components/NeoSwitch/NeoSwitch.scss
index aab2e5f3ba..803c8af81d 100644
--- a/libs/ui/src/components/NeoSwitch/NeoSwitch.scss
+++ b/libs/ui/src/components/NeoSwitch/NeoSwitch.scss
@@ -6,29 +6,22 @@
$switch-padding: 0;
$switch-width: 3rem;
+$switch-background: #{var(--background-color)};
+$switch-border-color: #{var(--border-color)};
+$switch-active-background-color: #{var(--toggle-primary)};
+$switch-action-background: #{var(--toggle-active-switch)};
+$switch-action-checked-background: #{var(--background-color)};
@import '@oruga-ui/oruga-next/src/scss/components/_switch.scss';
.o-switch {
- @include ktheme() {
- --oruga-switch-background: #{theme('background-color')};
- --oruga-switch-border-color: #{theme('border-color')};
- --oruga-switch-active-background-color: #{theme('toggle-primary')};
- --oruga-switch-action-background: #{theme('toggle-active-switch')};
- --oruga-switch-action-checked-background: #{theme('background-color')};
- }
&__check-switch {
- height: 1.5rem;
- width: 1.5rem;
- border: 1px solid var(--oruga-switch-border-color);
- margin-left: -1px;
- box-shadow: none;
+ @apply h-6 w-6 shadow-none border border-border-color -ml-px;
}
&__check {
- height: 1.5rem;
- border: 1px solid;
+ @apply h-6 border;
}
&__check--checked &__check-switch {
- background-color: var(--oruga-switch-action-checked-background);
+ @apply bg-background-color;
}
}
diff --git a/libs/ui/src/histoire.setup.ts b/libs/ui/src/histoire.setup.ts
index 630885e02e..ce74f6fc83 100644
--- a/libs/ui/src/histoire.setup.ts
+++ b/libs/ui/src/histoire.setup.ts
@@ -1 +1,28 @@
import './histoire.scss'
+
+import { defineSetupVue3 } from '@histoire/plugin-vue'
+import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
+import { Neo } from './'
+
+export const setupVue3 = defineSetupVue3(({ app }) => {
+ const script = document.createElement('script')
+ script.src = 'https://kit.fontawesome.com/54f29b7997.js'
+ script.crossOrigin = 'anonymous'
+ script.async = true
+
+ document.body.appendChild(script)
+
+ app.component('FontAwesomeIcon', FontAwesomeIcon).use(Neo, {
+ customIconPacks: {
+ fass: {
+ iconPrefix: 'fa-fw fa-',
+ },
+ fasr: {
+ iconPrefix: 'fa-fw fa-',
+ },
+ fab: {
+ iconPrefix: 'fa-fw fa-',
+ },
+ },
+ })
+})
diff --git a/libs/ui/src/scss/_theme.scss b/libs/ui/src/scss/_theme.scss
index 55201d6db2..9b36a07054 100644
--- a/libs/ui/src/scss/_theme.scss
+++ b/libs/ui/src/scss/_theme.scss
@@ -22,7 +22,7 @@ $themes: (
'k-redaccent2': #ffe6e6,
'k-grey': #999999,
'k-grey-fix': #999999,
- 'k-grey-light': #ECECEC,
+ 'k-grey-light': #f5f5f5,
'k-pink': #ffb6ef,
'k-yellow': #feffb6,
'k-blueaccent': #b6cbff,
@@ -73,7 +73,7 @@ $themes: (
'k-redaccent2': #390b0b,
'k-grey': #cccccc,
'k-grey-fix': #999999,
- 'k-grey-light': #ECECEC,
+ 'k-grey-light': #1f1f1f,
'k-pink': #7a2a68,
'k-yellow': #363234,
'k-blueaccent': #2e50a2,
diff --git a/libs/ui/src/scss/tailwind.scss b/libs/ui/src/scss/tailwind.scss
index e5947797c1..d9a8fa38c3 100644
--- a/libs/ui/src/scss/tailwind.scss
+++ b/libs/ui/src/scss/tailwind.scss
@@ -10,7 +10,7 @@
}
:root,
- :root.light-mode {
+ :root .light-mode {
--text-color: var(--black);
--text-color-inverse: var(--white);
--border-color: var(--black);
@@ -18,6 +18,7 @@
--background-color-inverse: #191718;
--link-hover: #6b6b6b;
--k-accent: #ff7ac3;
+ --k-accent2: #ff7ac3;
--k-accent-light: #ffe5f3;
--k-accent-hover: #ffe5f3;
--k-accent-light-2: #ffe5f3;
@@ -58,58 +59,16 @@
--toggle-active-switch: #d9d9d9;
}
- @media (prefers-color-scheme: dark) {
- :root {
- --black: #191718;
- --text-color: var(--white);
- --text-color-inverse: var(--black);
- --background-color: var(--black);
- --background-color-inverse: var(--white);
- --link-hover: #cccccc;
- --border-color: var(--white);
- --k-accent: #191718;
- --k-accent-hover: #363234;
- --k-accent-light-2: #363234;
- --k-accent-light-2-dark: var(--white);
- --k-accent-light-2-dark-head: var(--white);
- --k-accent-light-2-dark-paragraph: #b9b9b9;
- --k-red-accent: #b52c2c;
- --k-red-accent-2: #390b0b;
- --k-grey: #cccccc;
- --k-grey-fix: #999999;
- --k-pink: #7a2a68;
- --k-yellow: #363234;
- --k-blue-accent: #2e50a2;
- --k-aqua-blue: #106153;
- --k-green-accent: #056a02;
- --k-green-accent-2: #0a3009;
- --k-blue-light: #363234;
- --k-primary-light: #363234;
- --k-shade: #999999;
- --primary-shadow: 4px 4px #fff;
- --disabled: var(--black);
- --card-border-color: #6b6b6b;
- --card-border-color-light: #6b6b6b;
- --green-border-color: #056a02;
- --blue-accent-bg-color: #363234;
- --blue-light-hover-color: #363234;
- --blue-light-cards: #121d39;
- --card-hover-opacity: 0.8;
- --separator-line-color: #6b6b6b;
- --toggle-primary: var(--white);
- --toggle-active-switch: #363234;
- }
- }
-
- :root.dark-mode {
+ .dark-mode {
--black: #191718;
--text-color: var(--white);
--text-color-inverse: var(--black);
- --background-color: var(--black);
+ --background-color: #191718;
--background-color-inverse: var(--white);
--link-hover: #cccccc;
--border-color: var(--white);
--k-accent: #191718;
+ --k-accent2: var(--white);
--k-accent-hover: #363234;
--k-accent-light-2: #363234;
--k-accent-light-2-dark: var(--white);
diff --git a/libs/ui/tailwind.config.js b/libs/ui/tailwind.config.js
index 87039c6e1e..c5ad869c59 100644
--- a/libs/ui/tailwind.config.js
+++ b/libs/ui/tailwind.config.js
@@ -11,6 +11,7 @@ module.exports = {
'background-color-inverse': 'var(--background-color-inverse)',
'link-hover': 'var(--link-hover)',
'k-accent': 'var(--k-accent)',
+ 'k-accent2': 'var(--k-accent2)',
'k-accent-light': 'var(--k-accent-light)',
'k-accent-hover': 'var(--k-accent-hover)',
'k-accent-light-2': 'var(--k-accent-light-2)',
@@ -49,6 +50,22 @@ module.exports = {
'separator-line-color': 'var(--separator-line-color)',
'toggle-primary': 'var(--toggle-primary)',
'toggle-active-switch': 'var(--toggle-active-switch)',
+
+ neutral: {
+ 1: '#ffffff',
+ 2: '#fcfcfc',
+ 3: '#f5f5f5',
+ 4: '#f0f0f0',
+ 5: '#d9d9d9',
+ 6: '#bfbfbf',
+ 7: '#8c8c8c',
+ 8: '#595959',
+ 9: '#454545',
+ 10: '#262626',
+ 11: '#1f1f1f',
+ 12: '#141414',
+ 13: '#000000',
+ },
},
boxShadow: {
primary: 'var(--primary-shadow)',
@@ -67,6 +84,10 @@ module.exports = {
lineHeight: {
4.5: '1.125rem',
},
+ animation: {
+ 'icon-spin':
+ 'icon-spin infinite linear var(--oruga-icon-spin-duration, 1.5s)',
+ },
},
},
plugins: [],
diff --git a/locales/en.json b/locales/en.json
index a847260539..984a3af581 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -46,6 +46,7 @@
"Maximum NFTs in collection": "Maximum NFTs in collection",
"name": "Name",
"simple": "Simple",
+ "confirmed": "Confirmed",
"creative": "Creative",
"multipleNFTS": "Multiple NFT's",
"about": "About",
@@ -603,6 +604,8 @@
"onlyOneExample": "Example Of Drop",
"mintThisNft": "Mint This NFT",
"seeYourNft": "See Your NFT",
+ "minimumFundsDescription": "Holding a Minimum of
{0} in Your Wallet is Required for This Free Mint.",
+ "claimNftNow": "Claim NFT Now",
"nftAlreadyMinted": "NFT Already Minted",
"yourVariation": "Your Unique Variation",
"loader": {
@@ -616,11 +619,23 @@
},
"open": "Open",
"phase": "Mint Phase",
- "totalAvailableItem": "Total available items",
"ayeVotersOnly": "For Aye Voters Only",
"eligible": "You Are Eligible",
"exclusive": "Exclusive Access Only",
- "howItemWork": "How unlockable item works"
+ "howItemWork": "How unlockable item works",
+ "addFundsModal": {
+ "title": "Action Required",
+ "textP1": "To participate in this free, gasless drop, your wallet must hold a minimum of
{0}",
+ "textP2": "Please add funds to continue",
+ "howToAddFunds": "How to add funds",
+ "tooltip": {
+ "title": "Adding {0} to Your Wallet",
+ "onramp": "Onramp: Buy {0} with fiat via onramp in your wallet.",
+ "exchange": "Exchange: Purchase on a crypto exchange and transfer to your wallet.",
+ "transfer": "Transfer: Move {0} from another account to your wallet.",
+ "note": "Transactions may require a network confirmation"
+ }
+ }
},
"blockchain": {
"label": "Select Blockchain",
@@ -869,6 +884,7 @@
"totalItems": "Σ Items",
"todayTraded": "24H",
"totalTraded": "Σ VOLUME TRADED",
+ "totalSupply": "Total Supply",
"highestSale": "HIGHEST SALE",
"totalBuys": "Σ BUYS",
"unique": "UNIQUE",
@@ -971,7 +987,8 @@
"supports": "Supports",
"chooseProvider": "Choose A Provider",
"doingSomeMagic": "Doing some magic",
- "pleaseWait": "Please wait"
+ "pleaseWait": "Please wait",
+ "copy": "Copy"
},
"fiatOnRamp": {
"agree": "I agree to the",
@@ -992,7 +1009,8 @@
"copy": "Kodadot link successfully copied"
},
"builtOn": "Built on",
- "signStuckText": "Stuck? Make sure to check for any popups and SIGN the transaction."
+ "signStuckText": "Stuck? Make sure to check for any popups and SIGN the transaction.",
+ "unlimited": "Unlimited"
},
"cookies": {
"notice": "We use cookies for better service",
@@ -1059,7 +1077,7 @@
"receiveValue": "You will receive {0} {1} on {2} to",
"insufficientBalance": "Insufficient {0} Balance",
"insufficientAmountAfterFees": "Insufficient amount after fees",
- "proceedToConfirmation":"Proceed To Confirmation",
+ "proceedToConfirmation": "Proceed To Confirmation",
"artistProfile": "Go to artist's profile",
"usdInput": "USD Value (approx)",
"btnCopyPayment": "Copy Payment link",
@@ -1417,7 +1435,18 @@
"enterValidEmail": "Enter valid email address",
"subscribeAndClaim": "Subscribe & Claim your NFT",
"agreeToProceed": "Agree to proceed",
- "consent": "I consent to receive updates."
+ "consent": "I consent to receive updates.",
+ "plusGetA": "+ Get a",
+ "voucherToOurShop": "Voucher to our shop",
+ "justConfirmSubscriptionViaEmail": "Just confirm your subscription via email",
+ "claimingDrop": "Claiming drop",
+ "stayTuned": "Stay tuned — Your unique NFT is finalizing!",
+ "preparingYourNft": "Preparing Your NFT",
+ "youSuccessfullyClaimedNft": "You successfully claimed {0} NFT",
+ "artBy": "{0} By",
+ "viewNft": "View NFT",
+ "listNft": "List NFT",
+ "canList": "NFT ready for listing!"
},
"confirmPurchase": {
"action": "Confirm Purchase",
@@ -1452,6 +1481,7 @@
"fixedPrice": "Fixed Price",
"collectionFloorPrice": "Collection Floor Price",
"potentialEarnings": "Potential Earnings",
+ "listingFees": "Listing Fees",
"listForSale": "List For Sale",
"chooseAPrice": "Choose a price",
"floorPrice": "Floor Price",
@@ -1498,8 +1528,6 @@
"cta": "Migrate Items",
"own": "You Own {0} From This Collection"
},
- "migrationNotPossible": "Migration Not Possible:",
- "migrationNotPossibleLabel": "Migration Is Not Possible For Following Collections That You Own:",
"homeButton": "Migration Homepage",
"review": "Review",
"reviewCtaUncheck": "Acknowledge Before Proceeding",
diff --git a/middleware/prefix.global.ts b/middleware/prefix.global.ts
index 36754f27e3..3c64684474 100644
--- a/middleware/prefix.global.ts
+++ b/middleware/prefix.global.ts
@@ -15,6 +15,15 @@ export default defineNuxtRouteMiddleware((route) => {
(prefix) => location.hostname.startsWith(`${prefix}.`),
)
+ if (
+ [urlPrefix.value, prefixInPath].includes('dot') &&
+ route.name !== 'prefix-transfer'
+ ) {
+ setUrlPrefix('ahp')
+ navigateTo(route.path.replace(prefixInPath, 'ahp'))
+ return
+ }
+
if (rmrk2ChainPrefixInHostname) {
// fixed chain domain (for example: rmrk2.kodadot.xyz)
diff --git a/package.json b/package.json
index 20f6603a77..dc22cb8039 100644
--- a/package.json
+++ b/package.json
@@ -63,7 +63,7 @@
"@fortawesome/fontawesome-svg-core": "^6.4.2",
"@fortawesome/vue-fontawesome": "^3.0.5",
"@kodadot1/brick": "workspace:*",
- "@kodadot1/minimark": "^0.1.10",
+ "@kodadot1/minimark": "^0.1.13",
"@kodadot1/minipfs": "0.4.1-rc.0",
"@kodadot1/static": "workspace:*",
"@kodadot1/sub-api": "0.2.0-rc.0",
diff --git a/pages/[prefix]/explore/collectibles.vue b/pages/[prefix]/explore/collectibles.vue
index 5615ed7f5d..a0c20e05db 100644
--- a/pages/[prefix]/explore/collectibles.vue
+++ b/pages/[prefix]/explore/collectibles.vue
@@ -12,7 +12,7 @@ const { urlPrefix } = usePrefix()
const checkRouteAvailability = () => {
if (!explorerVisible(urlPrefix.value)) {
- navigateTo('/')
+ navigateTo('/ahp/explore/collectibles')
}
}
diff --git a/pages/[prefix]/explore/items.vue b/pages/[prefix]/explore/items.vue
index d439b461f2..a9b35483e5 100644
--- a/pages/[prefix]/explore/items.vue
+++ b/pages/[prefix]/explore/items.vue
@@ -17,7 +17,7 @@ const isSidebarOpen = computed(() => preferencesStore.getsidebarFilterCollapse)
const checkRouteAvailability = () => {
if (!explorerVisible(urlPrefix.value)) {
- navigateTo('/')
+ navigateTo('/ahp/explore/items')
}
}
diff --git a/params/types.ts b/params/types.ts
index e3a58e835f..dca8246b02 100644
--- a/params/types.ts
+++ b/params/types.ts
@@ -70,4 +70,5 @@ export type DropItem = {
type: DropType
meta: string
disabled: number
+ max?: number
}
diff --git a/plugins/icons.ts b/plugins/icons.ts
index 3f57f0daae..dee3017abc 100644
--- a/plugins/icons.ts
+++ b/plugins/icons.ts
@@ -18,6 +18,10 @@ export default defineNuxtPlugin((nuxtApp) => {
fasr: {
iconPrefix: 'fa-fw fa-',
},
+ // fa-sharp light
+ fasl: {
+ iconPrefix: 'fa-fw fa-',
+ },
// fa brands
fab: {
iconPrefix: 'fa-fw fa-',
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 652b015650..2fee735c71 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -24,8 +24,8 @@ importers:
specifier: workspace:*
version: link:libs/ui
'@kodadot1/minimark':
- specifier: ^0.1.10
- version: 0.1.10(@polkadot/api@10.9.1)(@polkadot/util-crypto@12.4.2)
+ specifier: ^0.1.13
+ version: 0.1.13(@polkadot/api@10.9.1)(@polkadot/util-crypto@12.4.2)
'@kodadot1/minipfs':
specifier: 0.4.1-rc.0
version: 0.4.1-rc.0
@@ -94,7 +94,7 @@ importers:
version: 20.10.0
'@vitejs/plugin-vue':
specifier: ^4.5.0
- version: 4.5.0(vite@4.4.11)(vue@3.3.9)
+ version: 4.5.0(vite@4.4.12)(vue@3.3.9)
apollo-boost:
specifier: ^0.4.9
version: 0.4.9(graphql@16.8.1)
@@ -136,7 +136,7 @@ importers:
version: 5.1.0
nuxt:
specifier: ^3.8.2
- version: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
+ version: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
nuxt-speedkit:
specifier: 3.0.0-next.27
version: 3.0.0-next.27(rollup@2.79.1)(vue@3.3.9)
@@ -172,7 +172,7 @@ importers:
version: 1.4.3
vite:
specifier: '*'
- version: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ version: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
vue-apollo:
specifier: ^3.1.1
version: 3.1.1(graphql-tag@2.12.6)
@@ -257,7 +257,7 @@ importers:
version: 6.12.0(eslint@8.54.0)(typescript@4.9.5)
'@vite-pwa/nuxt':
specifier: ^0.3.2
- version: 0.3.2(rollup@2.79.1)(vite@4.4.11)(workbox-window@6.6.0)
+ version: 0.3.2(rollup@2.79.1)(vite@4.4.12)(workbox-window@6.6.0)
'@vitest/coverage-istanbul':
specifier: ^0.34.6
version: 0.34.6(vitest@0.34.6)
@@ -320,7 +320,7 @@ importers:
version: 12.5.0
nuxt-simple-sitemap:
specifier: ^3.4.1
- version: 3.4.1(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11)(vue@3.3.9)
+ version: 3.4.1(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12)(vue@3.3.9)
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -384,6 +384,12 @@ importers:
libs/ui:
dependencies:
+ '@fortawesome/fontawesome-svg-core':
+ specifier: ^6.4.2
+ version: 6.4.2
+ '@fortawesome/vue-fontawesome':
+ specifier: ^3.0.5
+ version: 3.0.5(@fortawesome/fontawesome-svg-core@6.4.2)(vue@3.3.9)
'@google/model-viewer':
specifier: ^3.3.0
version: 3.3.0(three@0.158.0)
@@ -405,13 +411,13 @@ importers:
devDependencies:
'@histoire/plugin-vue':
specifier: ^0.17.6
- version: 0.17.6(histoire@0.17.6)(vite@4.5.0)(vue@3.3.9)
+ version: 0.17.6(histoire@0.17.6)(vite@4.4.12)(vue@3.3.9)
'@oruga-ui/oruga-next':
specifier: ^0.7.0
version: 0.7.0(vue@3.3.9)
'@vitejs/plugin-vue':
specifier: ^4.5.0
- version: 4.5.0(vite@4.5.0)(vue@3.3.9)
+ version: 4.5.0(vite@4.4.12)(vue@3.3.9)
autoprefixer:
specifier: ^10.4.16
version: 10.4.16(postcss@8.4.31)
@@ -423,7 +429,7 @@ importers:
version: 8.7.1(eslint@8.54.0)
histoire:
specifier: ^0.17.6
- version: 0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.5.0)
+ version: 0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.4.12)
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -431,8 +437,8 @@ importers:
specifier: ^3.3.5
version: 3.3.5
vite:
- specifier: ^4.5.0
- version: 4.5.0(@types/node@20.10.0)(sass@1.69.5)
+ specifier: ^4.4.12
+ version: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
packages:
@@ -2957,11 +2963,11 @@ packages:
'@hapi/hoek': 9.3.0
dev: true
- /@histoire/app@0.17.6(vite@4.5.0):
+ /@histoire/app@0.17.6(vite@4.4.12):
resolution: {integrity: sha512-SiuH/mMa2dqZmXuxqNzFB9oyQnP7OiC+kwXIvjxTcKAKT/u/Z63jUwgkhKzhKRmsdW5fgYKUa2kfLSF0FqOntg==}
dependencies:
- '@histoire/controls': 0.17.6(vite@4.5.0)
- '@histoire/shared': 0.17.6(vite@4.5.0)
+ '@histoire/controls': 0.17.6(vite@4.4.12)
+ '@histoire/shared': 0.17.6(vite@4.4.12)
'@histoire/vendors': 0.17.6
'@types/flexsearch': 0.7.6
flexsearch: 0.7.21
@@ -2970,7 +2976,7 @@ packages:
- vite
dev: true
- /@histoire/controls@0.17.6(vite@4.5.0):
+ /@histoire/controls@0.17.6(vite@4.4.12):
resolution: {integrity: sha512-weJ4fSt2eux2448WwibSki27vaMzxqjJtmvL8Q2fuHUTRaOSuLzsRjxMab3RHjCVgVt5lixpYbUuAbKchVM03A==}
dependencies:
'@codemirror/commands': 6.3.0
@@ -2980,24 +2986,24 @@ packages:
'@codemirror/state': 6.3.1
'@codemirror/theme-one-dark': 6.1.2
'@codemirror/view': 6.22.0
- '@histoire/shared': 0.17.6(vite@4.5.0)
+ '@histoire/shared': 0.17.6(vite@4.4.12)
'@histoire/vendors': 0.17.6
transitivePeerDependencies:
- vite
dev: true
- /@histoire/plugin-vue@0.17.6(histoire@0.17.6)(vite@4.5.0)(vue@3.3.9):
+ /@histoire/plugin-vue@0.17.6(histoire@0.17.6)(vite@4.4.12)(vue@3.3.9):
resolution: {integrity: sha512-DVGoYXPDcoJ55crD4cAXA0OGAS8fWHvKjvOApY1NLLN4DgRjxqHBVE6xCX/9Ai1VTM3izG6FJgXiXAbRVgv5KQ==}
peerDependencies:
histoire: ^0.17.6
vue: ^3.2.47
dependencies:
- '@histoire/controls': 0.17.6(vite@4.5.0)
- '@histoire/shared': 0.17.6(vite@4.5.0)
+ '@histoire/controls': 0.17.6(vite@4.4.12)
+ '@histoire/shared': 0.17.6(vite@4.4.12)
'@histoire/vendors': 0.17.6
change-case: 4.1.2
globby: 13.2.2
- histoire: 0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.5.0)
+ histoire: 0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.4.12)
launch-editor: 2.6.1
pathe: 1.1.1
vue: 3.3.9(typescript@4.9.5)
@@ -3005,7 +3011,7 @@ packages:
- vite
dev: true
- /@histoire/shared@0.17.6(vite@4.5.0):
+ /@histoire/shared@0.17.6(vite@4.4.12):
resolution: {integrity: sha512-ZcAawiwZ/LIU2eB2fy+AT/OjCTVa5TkVg08TL/KoACgMiQWt5BFJDhuvlupT8RcB4dDfVYE9AputZ2vFeciMvA==}
peerDependencies:
vite: ^2.9.0 || ^3.0.0 || ^4.0.0
@@ -3016,7 +3022,7 @@ packages:
chokidar: 3.5.3
pathe: 1.1.1
picocolors: 1.0.0
- vite: 4.5.0(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
dev: true
/@histoire/vendors@0.17.6:
@@ -3265,14 +3271,14 @@ packages:
engines: {node: '>=14.0'}
dev: false
- /@kodadot1/minimark@0.1.10(@polkadot/api@10.9.1)(@polkadot/util-crypto@12.4.2):
- resolution: {integrity: sha512-7BSZvFpaKjjbsexj0mJWlqmXlgfvF/xbIrxrcNuDTr1aCL1RnCqFGSC0nY30cc0qNW8hAUwGo4B4G9a/pr//xg==}
+ /@kodadot1/minimark@0.1.13(@polkadot/api@10.9.1)(@polkadot/util-crypto@12.4.2):
+ resolution: {integrity: sha512-AUCZoCutnzVpwzWRkdtGvUV1yLCJLb9spgc7oau1ryaWRcaVLaa0mzruu3zyznYr17KuEtdvSGzAL0fpqBurtg==}
peerDependencies:
'@polkadot/api': ~10.x
dependencies:
'@polkadot/api': 10.9.1
- '@polkadot/keyring': 12.4.2(@polkadot/util-crypto@12.4.2)(@polkadot/util@12.4.2)
- '@polkadot/util': 12.4.2
+ '@polkadot/keyring': 12.6.1(@polkadot/util-crypto@12.4.2)(@polkadot/util@12.6.1)
+ '@polkadot/util': 12.6.1
nanoid: 3.3.4
slugify: 1.6.6
transitivePeerDependencies:
@@ -3587,7 +3593,7 @@ packages:
/@nuxt/devalue@2.0.2:
resolution: {integrity: sha512-GBzP8zOc7CGWyFQS6dv1lQz8VVpz5C2yRszbXufwG/9zhStTIH50EtD87NmWbTMwXDvZLNg8GIpb1UFdH93JCA==}
- /@nuxt/devtools-kit@1.0.0(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11):
+ /@nuxt/devtools-kit@1.0.0(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12):
resolution: {integrity: sha512-cNloBepQYCBW6x/ctfCvyYRZudxhfgh5w5JDswpCzn7KXmm8U6abG2jyT0FXIaceW1d5QYMpGCN1RUw24wSvOA==}
peerDependencies:
nuxt: ^3.7.4
@@ -3596,14 +3602,14 @@ packages:
'@nuxt/kit': 3.8.2(rollup@2.79.1)
'@nuxt/schema': 3.8.1(rollup@2.79.1)
execa: 7.2.0
- nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
transitivePeerDependencies:
- rollup
- supports-color
dev: true
- /@nuxt/devtools-kit@1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11):
+ /@nuxt/devtools-kit@1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12):
resolution: {integrity: sha512-a/ZAVmrD5yOfUYhRVfC9afMkczzL8J8zdf0h6QHbTd33rJW/jmjwTn++RTdnbSD2gg2fSBRi/h8y17RmqIdb9g==}
peerDependencies:
nuxt: ^3.8.1
@@ -3612,8 +3618,8 @@ packages:
'@nuxt/kit': 3.8.2(rollup@2.79.1)
'@nuxt/schema': 3.8.2(rollup@2.79.1)
execa: 7.2.0
- nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
transitivePeerDependencies:
- rollup
- supports-color
@@ -3633,7 +3639,7 @@ packages:
rc9: 2.1.1
semver: 7.5.4
- /@nuxt/devtools@1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11):
+ /@nuxt/devtools@1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12):
resolution: {integrity: sha512-2mXvQiS3KTMF0fO80Y9WLx95yubRoIp2wSCarmhhqInPe8/0K9VZ4TUiTGF20ti45h0ky3OAxiVSmLfViwDWjg==}
hasBin: true
peerDependencies:
@@ -3641,7 +3647,7 @@ packages:
vite: '*'
dependencies:
'@antfu/utils': 0.7.6
- '@nuxt/devtools-kit': 1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11)
+ '@nuxt/devtools-kit': 1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12)
'@nuxt/devtools-wizard': 1.0.3
'@nuxt/kit': 3.8.2(rollup@2.79.1)
birpc: 0.2.14
@@ -3660,7 +3666,7 @@ packages:
local-pkg: 0.5.0
magicast: 0.3.2
nitropack: 2.8.0
- nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
+ nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
nypm: 0.3.3
ofetch: 1.3.3
ohash: 1.1.3
@@ -3674,9 +3680,9 @@ packages:
simple-git: 3.21.0
sirv: 2.0.3
unimport: 3.5.0(rollup@2.79.1)
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
- vite-plugin-inspect: 0.7.42(@nuxt/kit@3.8.2)(rollup@2.79.1)(vite@4.4.11)
- vite-plugin-vue-inspector: 4.0.0(vite@4.4.11)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
+ vite-plugin-inspect: 0.7.42(@nuxt/kit@3.8.2)(rollup@2.79.1)(vite@4.4.12)
+ vite-plugin-vue-inspector: 4.0.0(vite@4.4.12)
which: 3.0.1
ws: 8.14.2
transitivePeerDependencies:
@@ -4994,6 +5000,18 @@ packages:
tslib: 2.6.2
dev: false
+ /@polkadot/keyring@12.6.1(@polkadot/util-crypto@12.4.2)(@polkadot/util@12.6.1):
+ resolution: {integrity: sha512-cicTctZr5Jy5vgNT2FsNiKoTZnz6zQkgDoIYv79NI+p1Fhwc9C+DN/iMCnk3Cm9vR2gSAd2fSV+Y5iKVDhAmUw==}
+ engines: {node: '>=18'}
+ peerDependencies:
+ '@polkadot/util': 12.6.1
+ '@polkadot/util-crypto': 12.6.1
+ dependencies:
+ '@polkadot/util': 12.6.1
+ '@polkadot/util-crypto': 12.4.2(@polkadot/util@12.4.2)
+ tslib: 2.6.2
+ dev: false
+
/@polkadot/keyring@12.6.1(@polkadot/util-crypto@12.6.1)(@polkadot/util@12.6.1):
resolution: {integrity: sha512-cicTctZr5Jy5vgNT2FsNiKoTZnz6zQkgDoIYv79NI+p1Fhwc9C+DN/iMCnk3Cm9vR2gSAd2fSV+Y5iKVDhAmUw==}
engines: {node: '>=18'}
@@ -5071,7 +5089,7 @@ packages:
dependencies:
'@babel/runtime': 7.22.15
'@polkadot/util': 10.4.2
- '@substrate/ss58-registry': 1.43.0
+ '@substrate/ss58-registry': 1.44.0
dev: false
/@polkadot/networks@12.4.2:
@@ -5105,7 +5123,7 @@ packages:
dependencies:
'@babel/runtime': 7.22.15
'@polkadot/util': 8.7.1
- '@substrate/ss58-registry': 1.43.0
+ '@substrate/ss58-registry': 1.44.0
dev: false
/@polkadot/rpc-augment@10.11.1:
@@ -8067,13 +8085,13 @@ packages:
- encoding
- supports-color
- /@vite-pwa/nuxt@0.3.2(rollup@2.79.1)(vite@4.4.11)(workbox-window@6.6.0):
+ /@vite-pwa/nuxt@0.3.2(rollup@2.79.1)(vite@4.4.12)(workbox-window@6.6.0):
resolution: {integrity: sha512-VqYSaQvNMQx26Z/2L32gWIT5aJIkJw+Dot/ttqsmHMUv3CnbKBv+o1x5XFC24Zk1as5XKDocwyS2LF8+mhN8Hg==}
dependencies:
'@nuxt/kit': 3.8.2(rollup@2.79.1)
pathe: 1.1.1
ufo: 1.3.2
- vite-plugin-pwa: 0.17.2(vite@4.4.11)(workbox-window@6.6.0)
+ vite-plugin-pwa: 0.17.2(vite@4.4.12)(workbox-window@6.6.0)
transitivePeerDependencies:
- '@types/babel__core'
- rollup
@@ -8097,16 +8115,15 @@ packages:
transitivePeerDependencies:
- supports-color
- /@vitejs/plugin-vue@4.5.0(vite@4.4.11)(vue@3.3.9):
+ /@vitejs/plugin-vue@4.5.0(vite@4.4.12)(vue@3.3.9):
resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
vite: ^4.0.0 || ^5.0.0
vue: ^3.2.25
dependencies:
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
vue: 3.3.9(typescript@4.9.5)
- dev: false
/@vitejs/plugin-vue@4.5.0(vite@4.5.0)(vue@3.3.9):
resolution: {integrity: sha512-a2WSpP8X8HTEww/U00bU4mX1QpLINNuz/2KMNpLsdu3BzOpak3AGI1CJYBTXcc4SPhaD0eNRUp7IyQK405L5dQ==}
@@ -8437,7 +8454,7 @@ packages:
'@vueuse/core': 10.5.0(vue@3.3.9)
'@vueuse/metadata': 10.5.0
local-pkg: 0.5.0
- nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
+ nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
vue-demi: 0.14.6(vue@3.3.9)
transitivePeerDependencies:
- '@vue/composition-api'
@@ -8455,7 +8472,7 @@ packages:
'@vueuse/core': 9.13.0(vue@3.3.9)
'@vueuse/metadata': 9.13.0
local-pkg: 0.4.3
- nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11)
+ nuxt: 3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12)
vue-demi: 0.14.6(vue@3.3.9)
transitivePeerDependencies:
- '@vue/composition-api'
@@ -12245,16 +12262,16 @@ packages:
tslib: 2.6.2
dev: true
- /histoire@0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.5.0):
+ /histoire@0.17.6(@types/node@20.10.0)(sass@1.69.5)(vite@4.4.12):
resolution: {integrity: sha512-L9xLR0BFk+KIcpfDOPw5i0o4eq1ANj+f0i3xWS6F5yToV0jSu9Dh8eaagSrR1QbUpLoc7Kjhjq408Ecoop3JcA==}
hasBin: true
peerDependencies:
vite: ^2.9.0 || ^3.0.0 || ^4.0.0
dependencies:
'@akryum/tinypool': 0.3.1
- '@histoire/app': 0.17.6(vite@4.5.0)
- '@histoire/controls': 0.17.6(vite@4.5.0)
- '@histoire/shared': 0.17.6(vite@4.5.0)
+ '@histoire/app': 0.17.6(vite@4.4.12)
+ '@histoire/controls': 0.17.6(vite@4.4.12)
+ '@histoire/shared': 0.17.6(vite@4.4.12)
'@histoire/vendors': 0.17.6
'@types/flexsearch': 0.7.6
'@types/markdown-it': 12.2.3
@@ -12281,7 +12298,7 @@ packages:
sade: 1.8.1
shiki-es: 0.2.0
sirv: 2.0.3
- vite: 4.5.0(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
vite-node: 0.34.6(@types/node@20.10.0)(sass@1.69.5)
transitivePeerDependencies:
- '@types/node'
@@ -15007,10 +15024,10 @@ packages:
optionalDependencies:
fsevents: 2.3.3
- /nuxt-simple-sitemap@3.4.1(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11)(vue@3.3.9):
+ /nuxt-simple-sitemap@3.4.1(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12)(vue@3.3.9):
resolution: {integrity: sha512-1F7OeXQ1rnwWgHgHDeDejlslgyNMHRq1JWzFjRaE6O2QN3R6Rh5RcLzqfynQQ0HFtvv0eJ54E9+MCbvGYVFBuA==}
dependencies:
- '@nuxt/devtools-kit': 1.0.0(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11)
+ '@nuxt/devtools-kit': 1.0.0(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12)
'@nuxt/kit': 3.8.0(rollup@2.79.1)
chalk: 5.3.0
defu: 6.1.3
@@ -15087,7 +15104,7 @@ packages:
- vue
dev: false
- /nuxt@3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.11):
+ /nuxt@3.8.2(@types/node@20.10.0)(eslint@8.54.0)(rollup@2.79.1)(sass@1.69.5)(typescript@4.9.5)(vite@4.4.12):
resolution: {integrity: sha512-HUAyifmqTs2zcQBGvcby3KNs2pBAk+l7ZbLjD1oCNqQQ+wBuZ1qgLC4Ebu++y4g3o3Y8WAWSvpafbKRLQZziPw==}
engines: {node: ^14.18.0 || >=16.10.0}
hasBin: true
@@ -15101,7 +15118,7 @@ packages:
optional: true
dependencies:
'@nuxt/devalue': 2.0.2
- '@nuxt/devtools': 1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.11)
+ '@nuxt/devtools': 1.0.3(nuxt@3.8.2)(rollup@2.79.1)(vite@4.4.12)
'@nuxt/kit': 3.8.2(rollup@2.79.1)
'@nuxt/schema': 3.8.2(rollup@2.79.1)
'@nuxt/telemetry': 2.5.2(rollup@2.79.1)
@@ -16661,6 +16678,7 @@ packages:
hasBin: true
optionalDependencies:
fsevents: 2.3.3
+ dev: true
/rollup@3.29.4:
resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==}
@@ -18815,7 +18833,7 @@ packages:
vscode-languageserver-textdocument: 1.0.11
vscode-uri: 3.0.8
- /vite-plugin-inspect@0.7.42(@nuxt/kit@3.8.2)(rollup@2.79.1)(vite@4.4.11):
+ /vite-plugin-inspect@0.7.42(@nuxt/kit@3.8.2)(rollup@2.79.1)(vite@4.4.12):
resolution: {integrity: sha512-JCyX86wr3siQc+p9Kd0t8VkFHAJag0RaQVIpdFGSv5FEaePEVB6+V/RGtz2dQkkGSXQzRWrPs4cU3dRKg32bXw==}
engines: {node: '>=14'}
peerDependencies:
@@ -18834,12 +18852,12 @@ packages:
open: 9.1.0
picocolors: 1.0.0
sirv: 2.0.3
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
transitivePeerDependencies:
- rollup
- supports-color
- /vite-plugin-pwa@0.17.2(vite@4.4.11)(workbox-window@6.6.0):
+ /vite-plugin-pwa@0.17.2(vite@4.4.12)(workbox-window@6.6.0):
resolution: {integrity: sha512-aVH9sxcTDumiWYiNcLrFqu+FdL79I2cT5EhlVe5V6nGcC64yQNGT1jamMytwi+OdfXl4VYic0LtoJ6JHMkM3ZQ==}
engines: {node: '>=16.0.0'}
peerDependencies:
@@ -18849,7 +18867,7 @@ packages:
debug: 4.3.4(supports-color@9.4.0)
fast-glob: 3.3.2
pretty-bytes: 6.1.1
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
workbox-build: 7.0.0
workbox-window: 6.6.0
transitivePeerDependencies:
@@ -18857,7 +18875,7 @@ packages:
- supports-color
dev: true
- /vite-plugin-vue-inspector@4.0.0(vite@4.4.11):
+ /vite-plugin-vue-inspector@4.0.0(vite@4.4.12):
resolution: {integrity: sha512-xNjMbRj3YrebuuInTvlC8ghPtzT+3LjMIQPeeR/5CaFd+WcbA9wBnECZmlcP3GITCVED0SxGmTyoJ3iVKsK4vQ==}
peerDependencies:
vite: ^3.0.0-0 || ^4.0.0-0
@@ -18871,12 +18889,12 @@ packages:
'@vue/compiler-dom': 3.3.9
kolorist: 1.8.0
magic-string: 0.30.5
- vite: 4.4.11(@types/node@20.10.0)(sass@1.69.5)
+ vite: 4.4.12(@types/node@20.10.0)(sass@1.69.5)
transitivePeerDependencies:
- supports-color
- /vite@4.4.11(@types/node@20.10.0)(sass@1.69.5):
- resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==}
+ /vite@4.4.12(@types/node@20.10.0)(sass@1.69.5):
+ resolution: {integrity: sha512-KtPlUbWfxzGVul8Nut8Gw2Qe8sBzWY+8QVc5SL8iRFnpnrcoCaNlzO40c1R6hPmcdTwIPEDkq0Y9+27a5tVbdQ==}
engines: {node: ^14.18.0 || >=16.0.0}
hasBin: true
peerDependencies:
@@ -18906,47 +18924,10 @@ packages:
'@types/node': 20.10.0
esbuild: 0.18.20
postcss: 8.4.31
- rollup: 3.29.0
- sass: 1.69.5
- optionalDependencies:
- fsevents: 2.3.3
-
- /vite@4.4.11(@types/node@20.9.4)(sass@1.69.5):
- resolution: {integrity: sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==}
- engines: {node: ^14.18.0 || >=16.0.0}
- hasBin: true
- peerDependencies:
- '@types/node': '>= 14'
- less: '*'
- lightningcss: ^1.21.0
- sass: '*'
- stylus: '*'
- sugarss: '*'
- terser: ^5.4.0
- peerDependenciesMeta:
- '@types/node':
- optional: true
- less:
- optional: true
- lightningcss:
- optional: true
- sass:
- optional: true
- stylus:
- optional: true
- sugarss:
- optional: true
- terser:
- optional: true
- dependencies:
- '@types/node': 20.9.4
- esbuild: 0.18.20
- postcss: 8.4.31
- rollup: 3.29.0
+ rollup: 3.29.4
sass: 1.69.5
optionalDependencies:
fsevents: 2.3.3
- dev: true
/vite@4.5.0(@types/node@20.10.0)(sass@1.69.5):
resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==}
@@ -19074,7 +19055,7 @@ packages:
strip-literal: 1.3.0
tinybench: 2.5.0
tinypool: 0.7.0
- vite: 4.4.11(@types/node@20.9.4)(sass@1.69.5)
+ vite: 4.5.0(@types/node@20.9.4)(sass@1.69.5)
vite-node: 0.34.6(@types/node@20.9.4)(sass@1.69.5)
why-is-node-running: 2.2.2
transitivePeerDependencies:
diff --git a/queries/subsquid/general/collectionByIdMinimal.graphql b/queries/subsquid/general/collectionByIdMinimal.graphql
index 3c45c88c22..595198a294 100644
--- a/queries/subsquid/general/collectionByIdMinimal.graphql
+++ b/queries/subsquid/general/collectionByIdMinimal.graphql
@@ -10,6 +10,8 @@ query collectionByIdMinimal($id: String!) {
name
type
}
+ nftCount
+ max
metadata
name
currentOwner
diff --git a/queries/subsquid/general/collectionMigrateReady.graphql b/queries/subsquid/general/collectionMigrateReady.graphql
index a05dddb7e1..dda51b9fe1 100644
--- a/queries/subsquid/general/collectionMigrateReady.graphql
+++ b/queries/subsquid/general/collectionMigrateReady.graphql
@@ -1,4 +1,4 @@
-query collectionByAccount($account: String!) {
+query collectionMigrateReady($account: String!) {
collectionEntities(
where: { currentOwner_eq: $account }
orderBy: blockNumber_DESC
@@ -18,6 +18,12 @@ query collectionByAccount($account: String!) {
}
nfts(where: { burned_not_eq: true }) {
id
+ name
+ currentOwner
+ meta {
+ id
+ image
+ }
}
}
}
diff --git a/queries/subsquid/general/collectionMigrateWaiting.graphql b/queries/subsquid/general/collectionMigrateWaiting.graphql
index 5187bb973b..6625fd2ee5 100644
--- a/queries/subsquid/general/collectionMigrateWaiting.graphql
+++ b/queries/subsquid/general/collectionMigrateWaiting.graphql
@@ -1,10 +1,11 @@
-query collectionByAccount($account: String!) {
+query collectionMigrateWaiting($account: String!) {
collectionEntities(
where: { nfts_some: { currentOwner_eq: $account }, issuer_not_eq: $account }
) {
id
name
- nfts(where: { currentOwner_eq: $account }) {
+ currentOwner
+ nfts(where: { currentOwner_eq: $account, burned_eq: false }) {
id
}
metadata
diff --git a/queries/subsquid/general/collectionStatsById.graphql b/queries/subsquid/general/collectionStatsById.graphql
index 442269cd35..e9aa7b80d6 100644
--- a/queries/subsquid/general/collectionStatsById.graphql
+++ b/queries/subsquid/general/collectionStatsById.graphql
@@ -1,6 +1,7 @@
query collectionStatsById($id: String!) {
stats: collectionEntityById(id: $id) {
id
+ max
base: nfts(where: { burned_eq: false }) {
id
currentOwner
diff --git a/services/nftStorage.ts b/services/nftStorage.ts
index dfb6070fa5..8f829c63a9 100644
--- a/services/nftStorage.ts
+++ b/services/nftStorage.ts
@@ -80,4 +80,20 @@ export const pinFileToIPFS = async (file: Blob): Promise => {
return value.cid
}
+export const pinDirectory = async (files: File[]): Promise => {
+ const formData = new FormData()
+ files.forEach((file) => formData.append('file', file, file.name))
+
+ const response = await nftStorageApi('/pinFile', {
+ method: 'POST',
+ body: formData,
+ }).catch((error: FetchError) => {
+ throw new Error(
+ `[NFT::STORAGE] Unable to PIN Directory for reasons ${error.data}`,
+ )
+ })
+
+ return response.value.cid
+}
+
export default nftStorageApi
diff --git a/services/waifu.ts b/services/waifu.ts
index c5c9921fd5..bfb595b619 100644
--- a/services/waifu.ts
+++ b/services/waifu.ts
@@ -62,12 +62,20 @@ type DoRequest = {
email?: string
}
+export type DoResult = {
+ sn: string
+ collection: string
+ chain: string
+ txHash?: string
+ timestamp?: string
+ image?: string
+ name: string
+}
+
type DoResponse = {
- result: {
- sn: string
- collection: string
- }
+ result: DoResult
}
+
export const doWaifu = async (body: DoRequest, campaign: string) => {
const value = await api(`do/${campaign}`, {
method: 'POST',
diff --git a/stores/identity.ts b/stores/identity.ts
index e099ad3083..a3935805a9 100644
--- a/stores/identity.ts
+++ b/stores/identity.ts
@@ -4,7 +4,7 @@ import { defineStore } from 'pinia'
import consola from 'consola'
import { emptyObject } from '@/utils/empty'
import { formatAddress } from '@/utils/account'
-import { Prefix } from '@kodadot1/static'
+import type { Prefix } from '@kodadot1/static'
import { getKusamaAssetId } from '@/utils/api/bsx/query'
const DEFAULT_BALANCE_STATE = {
@@ -19,6 +19,16 @@ const DEFAULT_BALANCE_STATE = {
// movr: '0',
}
+const prefixToToken = {
+ ksm: 'KSM',
+ rmrk: 'KSM',
+ bsx: 'KSM',
+ ahk: 'KSM',
+ ahp: 'DOT',
+ dot: 'DOT',
+ ahr: 'ROC',
+}
+
export interface IdentityMap {
[address: string]: Registration
}
@@ -125,6 +135,14 @@ export const useIdentityStore = defineStore('identity', {
? state.auth.balance[urlPrefix.value] || '0'
: '0'
},
+ getAuthBalanceByChain: (state) => (prefix: Prefix) => {
+ return state.auth.balance ? state.auth.balance[prefix] || '0' : '0'
+ },
+ getAuthBalanceByRelayChain: (state) => (prefix: Prefix) => {
+ const relayChain = prefixToToken[prefix] === 'DOT' ? 'dot' : 'ksm'
+
+ return state.auth.balance ? state.auth.balance[relayChain] || '0' : '0'
+ },
getTotalUsd: (state) => {
if (
state.multiBalances &&
diff --git a/tests/e2e/collection.spec.ts b/tests/e2e/collection.spec.ts
index cb97be7e03..4c9e6d0398 100644
--- a/tests/e2e/collection.spec.ts
+++ b/tests/e2e/collection.spec.ts
@@ -1,104 +1,125 @@
import { expect, test } from './fixtures'
-const collectionName = 'Pare1d0scope'
-const collectionAddress = '/ahp/collection/38/'
+const COLLECTION_ADDRESS_PATH = '/ahp/collection/38/'
+const COLLECTION_NAME = 'Pare1d0scope'
+const COLLECTION_OWNER = '15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW'
test('Collection interactions', async ({ page, Commands }) => {
- await page.goto(collectionAddress)
+ await page.goto(COLLECTION_ADDRESS_PATH)
await Commands.scrollDownAndStop()
- await expect(page.getByTestId('collection-banner-name')).toContainText(
- collectionName,
- )
- //description show more
- await page.getByTestId('description-show-less-more-button').click()
- //collection description
- await expect(page.getByTestId('collection-description')).toContainText(
- 'Geometry',
- )
- //Share Button
- const shareBtn = await page.getByTestId('share-button').first()
- await shareBtn.click()
- await page.getByTestId('hero-copy-link-dropdown').first().click()
- await Commands.copyText('http://localhost:9090/ahp/collection/38')
- await shareBtn.click()
- await page.getByTestId('hero-share-QR-dropdown').first().click()
- await expect(page.getByTestId('hero-share-qrcode-modal')).toBeVisible()
- await page.keyboard.press('Escape')
- await shareBtn.click()
- await Commands.checkNewTab(
- 'https://twitter.com',
- await page.getByTestId('hero-share-twitter-dropdown').first().click(),
- )
+ await test.step('Check collection name and description', async () => {
+ await expect(page.getByTestId('collection-banner-name')).toContainText(
+ COLLECTION_NAME,
+ )
+ //description show more
+ await page.getByTestId('description-show-less-more-button').click()
+ //collection description
+ await expect(page.getByTestId('collection-description')).toContainText(
+ 'Geometry',
+ )
+ })
+
//ITEMS TAB ----------------------------
//Buy Now Filter
- await page.getByTestId('filter-checkbox-buynow').nth(1).click()
- await Commands.scrollDownAndStop()
- for (const el of await page.locator('[class="infinite-scroll-item"]').all()) {
- await expect(el).toContainText('DOT')
- }
+ await test.step('Verify if checking buy now filter only yield results with price ', async () => {
+ await page.getByTestId('filter-checkbox-buynow').nth(1).click()
+ await Commands.scrollDownAndStop()
+ for (const el of await page
+ .locator('[class="infinite-scroll-item"]')
+ .all()) {
+ await expect(el).toContainText('DOT')
+ }
+ })
+
//Buy Now Button on nft card opens wallet sidebar
- await page.locator('[class="infinite-scroll-item"]').first().hover()
- await page.getByTestId('item-buy').first().click()
- await expect(page.getByTestId('wallet-connect-sidebar-modal')).toBeVisible()
- await page.keyboard.press('Escape')
- await expect(
- page.getByTestId('wallet-connect-sidebar-modal'),
- ).not.toBeVisible()
+ await test.step('Verifies if buy now button on first NFT card opens connect wallet sidebar', async () => {
+ await page.locator('[class="infinite-scroll-item"]').first().hover()
+ await page.getByTestId('item-buy').first().click()
+ await expect(page.getByTestId('wallet-connect-sidebar-modal')).toBeVisible()
+ await page.keyboard.press('Escape')
+ await expect(
+ page.getByTestId('wallet-connect-sidebar-modal'),
+ ).not.toBeVisible()
+ })
+
//cart test
- await page.locator('[class="infinite-scroll-item"]').nth(0).hover()
- await page.getByTestId('item-add-to-cart').nth(0).click()
- await page.locator('[class="infinite-scroll-item"]').nth(1).hover()
- await page.getByTestId('item-add-to-cart').nth(1).click()
- await page.getByTestId('navbar-button-cart').click()
- await expect(page.getByTestId('shopping-cart-modal')).toBeVisible()
- await expect(page.getByTestId('shopping-cart-item').nth(0)).toContainText(
- collectionName,
- )
- await expect(page.getByTestId('shopping-cart-item').nth(1)).toContainText(
- collectionName,
- )
- await page.getByTestId('modal-close-button').click()
+ await test.step('Add two first nfts to cart and check if they got inserted', async () => {
+ await page.locator('[class="infinite-scroll-item"]').nth(0).hover()
+ await page.getByTestId('item-add-to-cart').nth(0).click()
+ await page.locator('[class="infinite-scroll-item"]').nth(1).hover()
+ await page.getByTestId('item-add-to-cart').nth(1).click()
+ await page.getByTestId('navbar-button-cart').click()
+ await expect(page.getByTestId('shopping-cart-modal')).toBeVisible()
+ await expect(page.getByTestId('shopping-cart-item').nth(0)).toContainText(
+ COLLECTION_NAME,
+ )
+ await expect(page.getByTestId('shopping-cart-item').nth(1)).toContainText(
+ COLLECTION_NAME,
+ )
+ await page.getByTestId('modal-close-button').click()
+ })
+
//art view
- await page.getByTestId('advanced-filter-collapsible').first().click()
- await page.getByTestId('filter-artview-checkbox').nth(1).click()
- await expect(page.getByTestId('nft-name')).not.toBeVisible()
- await page.getByTestId('filter-artview-checkbox').nth(1).click()
+ await test.step('Activates art view and check if NFT name was hidden', async () => {
+ await page.getByTestId('advanced-filter-collapsible').first().click()
+ await page.getByTestId('filter-artview-checkbox').nth(1).click()
+ await Commands.scrollDownAndStop()
+ await expect(page.getByTestId('nft-name')).not.toBeVisible()
+ await page.getByTestId('filter-artview-checkbox').nth(1).click()
+ })
+
//ACTIVITY TAB ----------------------------
- await page.getByTestId('collection-tab-activity').nth(1).click()
- await Commands.scrollDownAndStop()
+ await test.step('Switches to activity tab', async () => {
+ await page.getByTestId('collection-tab-activity').nth(1).click()
+ await Commands.scrollDownAndStop()
+ })
+
//chart
- await expect(page.getByTestId('collection-activity-chart')).toBeVisible()
+ await test.step('Checks chart visibility', async () => {
+ await expect(page.getByTestId('collection-activity-chart')).toBeVisible()
+ })
+
//Holders Tab
- const holdersTab = page.getByTestId('collection-holders-container')
- //check if nft details on Holders tab has content
- await page.getByTestId('collection-holder-nft-details').first().click()
- await expect(holdersTab).toContainText(collectionName)
- //check if popover on Holders is present
- await expect(page.getByTestId('collection-nft-holder').first()).toBeVisible()
- await page.getByTestId('collection-nft-holder-address').first().hover()
- await expect(page.getByTestId('identity-popover-container')).toBeVisible()
+ await test.step('Holders tab Interactions', async () => {
+ const holdersTab = page.getByTestId('collection-holders-container')
+ //check if nft details on Holders tab has content
+ await page.getByTestId('collection-holder-nft-details').first().click()
+ await expect(holdersTab).toContainText(COLLECTION_NAME)
+ //check if popover on Holders is present
+ await expect(
+ page.getByTestId('collection-nft-holder').first(),
+ ).toBeVisible()
+ await page.getByTestId('collection-nft-holder-address').first().hover()
+ await expect(page.getByTestId('identity-popover-container')).toBeVisible()
+ })
+
//event filters
- const eventTable = page.getByTestId('nfts-event-table')
- const saleFilter = page.getByTestId('event-checkbox-filter-sale').nth(1)
- const listingFilter = page.getByTestId('event-checkbox-filter-listing').nth(1)
- const mintFilter = page.getByTestId('event-checkbox-filter-mint').nth(1)
- const transferFilter = page
- .getByTestId('event-checkbox-filter-transfer')
- .nth(1)
- await saleFilter.check()
- await expect(eventTable).toContainText('Sale')
- await saleFilter.uncheck()
- await listingFilter.check()
- await expect(eventTable).toContainText('List')
- await listingFilter.uncheck()
- await mintFilter.check()
- await expect(eventTable).toContainText('Mint')
- await mintFilter.uncheck()
- await transferFilter.check()
- await expect(eventTable).toContainText('Transfer')
- //check if creator address redirects to proper page
- await page.getByTestId('collection-creator-address').click()
- await expect(page).toHaveURL(
- '/ahp/u/15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW',
- )
+ await test.step('Event Filters(sale,list,mint,transfer)', async () => {
+ const eventTable = page.getByTestId('nfts-event-table')
+ const saleFilter = page.getByTestId('event-checkbox-filter-sale').nth(1)
+ const listingFilter = page
+ .getByTestId('event-checkbox-filter-listing')
+ .nth(1)
+ const mintFilter = page.getByTestId('event-checkbox-filter-mint').nth(1)
+ const transferFilter = page
+ .getByTestId('event-checkbox-filter-transfer')
+ .nth(1)
+ await saleFilter.check()
+ await expect(eventTable).toContainText('Sale')
+ await saleFilter.uncheck()
+ await listingFilter.check()
+ await expect(eventTable).toContainText('List')
+ await listingFilter.uncheck()
+ await mintFilter.check()
+ await expect(eventTable).toContainText('Mint')
+ await mintFilter.uncheck()
+ await transferFilter.check()
+ await expect(eventTable).toContainText('Transfer')
+ })
+
+ //Creator link
+ await test.step('Check if creator address redirects to proper page', async () => {
+ await page.getByTestId('collection-creator-address').click()
+ await expect(page).toHaveURL(`/ahp/u/${COLLECTION_OWNER}`)
+ })
})
diff --git a/tests/e2e/createcollection.spec.ts b/tests/e2e/createcollection.spec.ts
index 9b0b668f75..c3d5450107 100644
--- a/tests/e2e/createcollection.spec.ts
+++ b/tests/e2e/createcollection.spec.ts
@@ -1,65 +1,91 @@
import { expect, test } from './fixtures'
+const CREATE_COLLECTION_PATH = '/create/collection'
+
test('Fill fields to check if they work', async ({ page, Commands }) => {
- //E2E connection
- await Commands.e2elogin()
- //Goto
- await page.goto('/create/collection')
- //upload image logo
- await page.setInputFiles('input[type="file"]', 'tests/e2e/unsplash-image.jpg')
- //checks if Collection Name Title Exists
- await expect(
- page
+ await test.step('Login and goto create collection ', async () => {
+ //E2E connection
+ await Commands.e2elogin()
+ //Goto
+ await page.goto(CREATE_COLLECTION_PATH)
+ })
+ await test.step('Upload image ', async () => {
+ //upload image logo
+ await page.setInputFiles(
+ 'input[type="file"]',
+ 'tests/e2e/unsplash-image.jpg',
+ )
+ })
+ await test.step('Fill collection name and description', async () => {
+ //checks if Collection Name Title Exists
+ await expect(
+ page
+ .getByTestId('collection-name')
+ .filter({ has: page.getByText('Collection Name') }),
+ ).toHaveCount(1)
+ await page
.getByTestId('collection-name')
- .filter({ has: page.getByText('Collection Name') }),
- ).toHaveCount(1)
- await page
- .getByTestId('collection-name')
- .locator('input')
- .fill('Best Collection Name')
- // Fill collection Description
- await page.getByTestId('collection-desc').fill('Best Collection Ever Created')
- //active unlimited items switch
- const collectionAmount = page.getByTestId('collection-maxAmount')
- await collectionAmount.locator('.o-switch').click()
- await expect(
- collectionAmount.getByPlaceholder('1 is the minimum'),
- ).toBeVisible()
- //Check if button exists
- await expect(page.getByTestId('collection-create')).toBeVisible()
- await expect(
- page
- .getByTestId('collection-create')
- .filter({ has: page.getByText('Not Enough Funds') }),
- ).toHaveCount(1)
+ .locator('input')
+ .fill('Best Collection Name')
+ // Fill collection Description
+ await page
+ .getByTestId('collection-desc')
+ .fill('Best Collection Ever Created')
+ })
+ await test.step('Activate unlimited items switch and verify if input is shown', async () => {
+ //active unlimited items switch
+ const collectionAmount = page.getByTestId('collection-maxAmount')
+ await collectionAmount.locator('.o-switch').click()
+ await expect(
+ collectionAmount.getByTestId('collection-input-maximum-nfts'),
+ ).toBeVisible()
+ })
+ await test.step('Check if create collection button is on page', async () => {
+ //Check if button exists
+ await expect(page.getByTestId('collection-create')).toBeVisible()
+ await expect(
+ page
+ .getByTestId('collection-create')
+ .filter({ has: page.getByText('Not Enough Funds') }),
+ ).toHaveCount(1)
+ })
})
test('Check if chain change works using the dropdown', async ({
page,
Commands,
}) => {
- //E2E connection
- await Commands.e2elogin()
- await page.goto('/create/collection')
- expect(page.getByTestId('collection-chain')).toBeVisible()
- await page.getByTestId('collection-chain').selectOption('KusamaHub')
- //Check if balances and deposits shows
- await expect(page.getByTestId('collection-deposit')).toBeVisible({
- timeout: 30000,
+ await test.step('Login and goto create collection', async () => {
+ await Commands.e2elogin()
+ await page.goto(CREATE_COLLECTION_PATH)
})
- await expect(page.getByTestId('collection-balance')).toBeVisible({
- timeout: 30000,
+
+ //Chain dropdown
+ await test.step('Wait for chain dropdown to be visible and select Kusamahub', async () => {
+ expect(page.getByTestId('collection-chain')).toBeVisible()
+ await page.getByTestId('collection-chain').selectOption('KusamaHub')
+ })
+
+ //Deposits and Balance
+ await test.step('Verify if balances are loaded', async () => {
+ await expect(page.getByTestId('collection-deposit')).toBeVisible({
+ timeout: 30000,
+ })
+ await expect(page.getByTestId('collection-balance')).toBeVisible({
+ timeout: 30000,
+ })
+ })
+
+ //Dropdown change to RMRK2
+ await test.step('Changes to RMRK2 and verifies if chain changed', async () => {
+ await page.getByTestId('collection-chain').selectOption('RMRK2')
+ await expect(page.getByTestId('chain')).toContainText('rmrk2')
})
- await page.getByTestId('collection-chain').selectOption('RMRK2')
})
-test('Show warning message on field when collection name empty', async ({
- page,
-}) => {
- await page.goto('/create/collection')
- // defines a variable containing the collection name data-testid
+test('Verifies error message if collection name is empty', async ({ page }) => {
+ await page.goto(CREATE_COLLECTION_PATH)
const collectionName = page.getByTestId('collection-name')
- // Fill and check if Collection Name works properly by checking warning
await collectionName.locator('input').fill('Kodadot Warning Test')
await collectionName.locator('input').fill('')
await page.getByTestId('collection-desc').click()
diff --git a/tests/e2e/createnft.spec.ts b/tests/e2e/createnft.spec.ts
index aeae373911..5a310a72d8 100644
--- a/tests/e2e/createnft.spec.ts
+++ b/tests/e2e/createnft.spec.ts
@@ -1,84 +1,118 @@
import { expect, test } from './fixtures'
+const CREATE_NFT_PATH = '/ksm/create'
+
test('Create NFT', async ({ page, Commands }) => {
const numOfCopies = 5
- await Commands.e2elogin()
- //await page.goto('/ahk/create')
- await page.goto('/ksm/create')
- await page.getByTestId('create-landing-nft-button').click()
- await expect(page).toHaveURL('/ksm/create?select=nft')
- //Single NFT
- await test.step('Single NFT', async () => {
+ //Login and navigation
+ await test.step('Login and navigate trough create single nft menus', async () => {
+ await Commands.e2elogin()
+ await page.goto(CREATE_NFT_PATH)
await Commands.acceptCookies()
- //select single nft creation
+ await page.getByTestId('create-landing-nft-button').click()
+ await expect(page).toHaveURL(`${CREATE_NFT_PATH}?select=nft`)
await page.getByTestId('create-landing-single-nft-button').click()
- //upload NFT image
+ })
+
+ //image upload
+ await test.step('Upload image into dropupload', async () => {
await page.setInputFiles(
'input[type="file"]',
'tests/e2e/unsplash-image.jpg',
)
- //set name
+ })
+
+ //Fill fields
+ await test.step('Fill name, description and select Ahk on chain dropdown', async () => {
await page
.getByTestId('create-nft-input-name')
.fill('Parametric NFT divergencies')
- //set description
await page
.getByTestId('create-nft-input-description')
.fill('Testing purpose NFT description using Playwright')
- //select AHK chain on dropdown
await page
.getByTestId('create-nft-dropdown-select')
.selectOption('KusamaHub')
await expect(page.getByTestId('chain')).toHaveText('ahk')
- //list for sale switch
+ })
+
+ //List for sale
+ await test.step('Activates list for sale switch and set a price on the input ', async () => {
await page.getByTestId('create-nft-sale-switch').click()
- //set price
await page.getByTestId('create-nft-input-list-value').fill('5.5')
- //set number of copies
+ })
+
+ //Copies
+ await test.step('Set number of copies and verifies if hashtag switch is present and click it', async () => {
await page
.getByTestId('create-nft-input-copies')
.fill(numOfCopies.toString())
await expect(
page.getByTestId('create-nft-input-copies-switch'),
).toBeVisible()
- //activate hastag switch
await page.getByTestId('create-nft-input-copies-switch').click()
- // - - NFT attributes interactions - -
+ })
+
+ //NFT attributes
+ await test.step('Create, fill and delete NFT attributes', async () => {
//open NFT attribute section
await page.getByTestId('create-nft-properties').click()
//add new attribute
await page.getByTestId('button-add-attribute').click()
//fill section
- await page.getByTestId('attr-0').getByPlaceholder('Section').fill('BG')
+ await page
+ .getByTestId('attr-0')
+ .getByTestId('attribute-input-section')
+ .fill('BG')
//fill value
- await page.getByTestId('attr-0').getByPlaceholder('Value').fill('Red')
+ await page
+ .getByTestId('attr-0')
+ .getByTestId('attribute-input-value')
+ .fill('Red')
//add new attribute
await page.getByTestId('button-add-attribute').click()
- await page.getByTestId('attr-1').getByPlaceholder('Section').fill('Dress')
- await page.getByTestId('attr-1').getByPlaceholder('Value').fill('Blue')
+ await page
+ .getByTestId('attr-1')
+ .getByTestId('attribute-input-section')
+ .fill('Dress')
+ await page
+ .getByTestId('attr-1')
+ .getByTestId('attribute-input-value')
+ .fill('Blue')
//remove last attribute
await page.getByTestId('attribute-button-remove').last().click()
await expect(page.getByTestId('attr-1')).not.toBeVisible()
- //royalty
+ })
+
+ //Royalty
+ await test.step('Sets a royalty percentage, activate the custom royalty switch and verifies its existance', async () => {
const royaltyFields = page
.getByTestId('royalty-form-input-percentage')
.locator('input')
await royaltyFields.fill('5')
//royalty switch
await page.getByTestId('royalty-form-switch').click()
- //get user address
const royaltyCustom = page
.getByTestId('royalty-form-custom-address')
.locator('input')
await expect(royaltyCustom).toBeVisible()
- //NSFW switch
+ })
+
+ //NSFW switch
+ await test.step('Activates NSFW switch', async () => {
await page.getByTestId('create-nft-nsfw-switch').click()
- //deposit check
+ })
+
+ //Deposit
+ await test.step('Check if deposits are loaded and properly calculated', async () => {
const expectedDeposit = `${0.0077 * numOfCopies} KSM`
await expect(
page.getByTestId('create-nft-deposit-amount-token'),
).toHaveText(expectedDeposit, { timeout: 30000 })
- //preview box
+ })
+
+ //preview box
+ await test.step('Verifies if contents of the preview box match fields from form', async () => {
await expect(page.getByTestId('create-nft-preview-box')).toBeVisible()
expect(
(await page.getByTestId('nft-preview-name').innerText()).valueOf(),
@@ -86,7 +120,10 @@ test('Create NFT', async ({ page, Commands }) => {
expect(
(await page.getByTestId('nft-preview-price').innerText()).valueOf(),
).toContain('5.5')
- //learn more link
+ })
+
+ //learn more link
+ await test.step('Click on the Learn More link and check if new tab has proper URL', async () => {
await expect(page.getByTestId('create-nft-learn-more-link')).toBeVisible()
await Commands.checkNewTab(
'https://hello.kodadot.xyz/multi-chain/fees',
diff --git a/tests/e2e/explore.spec.ts b/tests/e2e/explore.spec.ts
index 87f5fd8018..c392e5e921 100644
--- a/tests/e2e/explore.spec.ts
+++ b/tests/e2e/explore.spec.ts
@@ -1,65 +1,93 @@
import { expect, test } from './fixtures'
-test('Explore collections at ahk and sort by newest', async ({
- page,
- Commands,
-}) => {
- await page.goto('/ahk/explore/collectibles')
- const tabs = page.getByTestId('gallery-explore-tabs').nth(1)
- await expect(tabs.getByText('Collections')).toBeVisible()
- await expect(tabs.getByText('Items')).toBeVisible()
- const sortDropdown = page.getByTestId('explore-sort-dropdown').nth(1)
- await sortDropdown.click()
- await sortDropdown.getByText('Newest').click()
- await page.keyboard.press('Escape')
- await Commands.scrollDownAndStop()
- await page.waitForFunction(() => {
- const images = Array.from(document.querySelectorAll('img'))
- return images.every((img) => img.complete)
+const EXPLORE_COLLECTIONS_PATH = '/ahk/explore/collectibles'
+const EXPLORE_ITEMS_PATH = '/ahk/explore/items?page=1'
+
+test('Explore collections', async ({ page, Commands }) => {
+ await page.goto(EXPLORE_COLLECTIONS_PATH)
+
+ //Tabs
+ await test.step('Verify tab existance', async () => {
+ const tabs = page.getByTestId('gallery-explore-tabs').nth(1)
+ await expect(tabs.getByText('Collections')).toBeVisible()
+ await expect(tabs.getByText('Items')).toBeVisible()
+ })
+
+ //Sort Dropdown
+ await test.step('Sort by Newest using filter', async () => {
+ const sortDropdown = page.getByTestId('explore-sort-dropdown').nth(1)
+ await sortDropdown.click()
+ await sortDropdown.getByText('Newest').click()
+ await page.keyboard.press('Escape')
})
- await expect(page.getByTestId('collection-index-0').first()).toBeVisible({
- timeout: 10000,
+
+ //Lazy loading mitigation
+ await test.step('Scroll down and wait for images to load', async () => {
+ await Commands.scrollDownAndStop()
+ await page.waitForFunction(() => {
+ const images = Array.from(document.querySelectorAll('img'))
+ return images.every((img) => img.complete)
+ })
+ })
+
+ //Results
+ await test.step('Verify if explore results have loaded accordingly', async () => {
+ await expect(page.getByTestId('collection-index-0').first()).toBeVisible({
+ timeout: 10000,
+ })
+ expect(
+ page.locator('[class="collection-detail__name"]').first().innerText,
+ ).not.toContain('')
})
- expect(
- page.locator('[class="collection-detail__name"]').first().innerText,
- ).not.toContain('')
})
-test('Explore Items on ahk, sort by ascending price and filter by minimum 100 KSM', async ({
- page,
- Commands,
-}) => {
- await page.goto('/ahk/explore/items?page=1')
- const tabs = page.getByTestId('gallery-explore-tabs').nth(1)
- await expect(tabs.getByText('Collections')).toBeVisible()
- await expect(tabs.getByText('Items')).toBeVisible()
- const expandSearch = page.getByTestId('sidebar-price-filter')
- await expandSearch.click()
- const inputMin = await expandSearch.getByTestId('input-min')
- await inputMin.type('100')
- const btnApply = await expandSearch.getByTestId('apply').first()
- await Promise.all([
- page.waitForResponse(
- (resp) => resp.url().includes('imagedelivery.net') && resp.ok(),
- ),
- btnApply.click(),
- ])
- const exploreSort = await page.getByTestId('explore-sort-dropdown').nth(1)
- await exploreSort.click()
- await page.getByTestId('price_ASC').nth(1).click()
- const btnAsc = await page.$('[value="price_ASC"]')
- await btnAsc?.click()
- await page.keyboard.press('Escape')
- //active and deactive buy now, since its buggy
- await page.getByTestId('filter-checkbox-buynow').nth(1).click()
- await page.getByTestId('filter-checkbox-buynow').nth(1).click()
- await Commands.scrollDownAndStop()
- await expect(page.getByTestId('card-money').first()).toBeVisible({
- timeout: 10000,
+test('Explore Items', async ({ page, Commands }) => {
+ await page.goto(EXPLORE_ITEMS_PATH)
+
+ //Tabs
+ await test.step('Verify tab existance', async () => {
+ const tabs = page.getByTestId('gallery-explore-tabs').nth(1)
+ await expect(tabs.getByText('Collections')).toBeVisible()
+ await expect(tabs.getByText('Items')).toBeVisible()
+ })
+
+ //Filter
+ await test.step('Apply filter of 100 KSM minium on results', async () => {
+ const expandSearch = page.getByTestId('sidebar-price-filter')
+ await expandSearch.click()
+ const inputMin = expandSearch.getByTestId('input-min')
+ await inputMin.fill('100')
+ const btnApply = expandSearch.getByTestId('apply').first()
+ await btnApply.click()
+ })
+
+ //Sort Results
+ await test.step('Sort results by price, ascending', async () => {
+ const exploreSort = page.getByTestId('explore-sort-dropdown').nth(1)
+ await exploreSort.click()
+ await page.getByTestId('price_ASC').nth(1).click()
+ const btnAsc = await page.$('[value="price_ASC"]')
+ await btnAsc?.click()
+ await page.keyboard.press('Escape')
+ })
+
+ //mitigate lazy loading
+ await test.step('Scroll down, verify first card and filter tag existance', async () => {
+ await Commands.scrollDownAndStop()
+ await expect(page.getByTestId('card-money').first()).toBeVisible({
+ timeout: 10000,
+ })
+ await expect(page.getByTestId('neo-tag-component').nth(0)).toBeVisible()
+ await expect(page.getByTestId('neo-tag-component').nth(1)).toBeVisible({
+ timeout: 10000,
+ })
+ })
+
+ //Listing price
+ await test.step('Checks if first NFT card is listed and its value is equal or greater than 100 KSM', async () => {
+ const firstCardMoney = page.getByTestId('card-money').first()
+ const moneyStr = await firstCardMoney.innerText()
+ const money = +moneyStr.split(' ')[0]
+ expect(money).toBeGreaterThanOrEqual(100)
})
- const firstCardMoney = page.getByTestId('card-money').first()
- await expect(firstCardMoney).not.toBeEmpty()
- const moneyStr = await firstCardMoney.innerText()
- const money = +moneyStr.split(' ')[0]
- expect(money).toBeGreaterThanOrEqual(100)
})
diff --git a/tests/e2e/footer.spec.ts b/tests/e2e/footer.spec.ts
index 880a4732c0..6b2d50f852 100644
--- a/tests/e2e/footer.spec.ts
+++ b/tests/e2e/footer.spec.ts
@@ -81,7 +81,7 @@ const footerSocialMediaLinks = [
test('Check Footer Subscription', async ({ page }) => {
await page.goto('/')
const footerSubscribe = page.getByTestId('footer-subscribe')
- await footerSubscribe.getByPlaceholder('jane.doe@kodadot.xyz').fill('a')
+ await footerSubscribe.locator('input').fill('a')
await footerSubscribe.locator('button').click()
await expect(footerSubscribe.locator('.error')).toBeVisible()
})
diff --git a/tests/e2e/galleryitem.spec.ts b/tests/e2e/galleryitem.spec.ts
index 41318c11dd..361cab1554 100644
--- a/tests/e2e/galleryitem.spec.ts
+++ b/tests/e2e/galleryitem.spec.ts
@@ -1,80 +1,67 @@
import { expect, test } from './fixtures'
-test('Element existance verification', async ({ page }) => {
- await page.goto('/ahk/gallery/6-10')
- //activity tab
- await page
- .getByTestId('gallery-item-tabs')
- .locator('[aria-controls="1-content"]')
- .click()
- await page.getByTestId('gallery-item-activity-filter-all').click()
- await expect(
- page.getByTestId('gallery-item-activity-table').locator('td').first(),
- ).toBeVisible()
- //details tab
- await page
- .getByTestId('gallery-item-description-neotabs')
- .locator('[aria-controls="2-content"]')
- .click()
- await expect(
- page.getByTestId('gallery-item-details-tab-content'),
- ).toBeVisible()
- //chart tab
- await page
- .getByTestId('gallery-item-tabs')
- .locator('[aria-controls="2-content"]')
- .click()
- await expect(page.getByTestId('gallery-item-chart')).toBeVisible()
- //checks if page redirects properly to collection
- await page.getByTestId('gallery-item-collection-link').click()
- await expect(page).toHaveURL('/ahk/collection/6')
-})
+const COLLECTION_ADDRESS_PATH = '/ahk/gallery/6-10'
-test('Share Button Functionality', async ({ page }) => {
- await page.goto('/ahk/gallery/6-10')
- const shareBtn = page.getByTestId('gallery-item-share-button')
- await shareBtn.click()
- //Copy Link
- await shareBtn.getByText('Copy Link').click()
- const clipboardText1 = await page.evaluate('navigator.clipboard.readText()')
- expect(clipboardText1).toContain('/ahk/gallery/6-10')
- //Twitter
- await shareBtn.click()
- await shareBtn.getByTestId('gallery-item-share-dropdown-twitter').click()
- const newTabPromise = page.waitForEvent('popup')
- const newTab = await newTabPromise
- await newTab.waitForLoadState()
- await expect(newTab).toHaveURL(
- 'https://twitter.com/i/flow/login?redirect_after_login=%2Fintent%2Ftweet%3Ftext%3DCheck%2520out%2520this%2520awesome%2520NFT%2520on%2520KodaDot%26via%3DKodaDot%26url%3Dhttp%3A%2F%2Flocalhost%3A9090%2Fahk%2Fgallery%2F6-10',
- )
- await newTab.close()
- //QR Code
- await shareBtn.click()
- await shareBtn.getByText('QR Code').click()
- await expect(
- page.getByTestId('gallery-item-share-dropdown-qrcode'),
- ).toBeVisible()
-})
+test('Gallery item Interactions', async ({ page }) => {
+ await page.goto(COLLECTION_ADDRESS_PATH)
-test('More Button Functionality', async ({ page }) => {
- await page.goto('/ahk/gallery/6-10')
- //more button
- await page.getByTestId('gallery-item-more-button').click()
- const downloadPromise = page.waitForEvent('download')
- await page.getByTestId('gallery-item-more-dropdown-download').click()
- await downloadPromise
-})
+ //Activity tab
+ await test.step('Verifies if activity tab has content', async () => {
+ await page
+ .getByTestId('gallery-item-tabs')
+ .locator('[aria-controls="1-content"]')
+ .click()
+ await page.getByTestId('gallery-item-activity-filter-all').click()
+ await expect(
+ page.getByTestId('gallery-item-activity-table').locator('td').first(),
+ ).toBeVisible()
+ })
+
+ //Details tab
+ await test.step('Verifies if content inside details tab is visible', async () => {
+ await page
+ .getByTestId('gallery-item-description-neotabs')
+ .locator('[aria-controls="2-content"]')
+ .click()
+ await expect(
+ page.getByTestId('gallery-item-details-tab-content'),
+ ).toBeVisible()
+ })
+
+ //Chart tab
+ await test.step('Verify chart visibility', async () => {
+ await page
+ .getByTestId('gallery-item-tabs')
+ .locator('[aria-controls="2-content"]')
+ .click()
+ await expect(page.getByTestId('gallery-item-chart')).toBeVisible()
+ })
+
+ //More Button
+ await test.step('More Button Functionality', async () => {
+ await page.getByTestId('gallery-item-more-button').click()
+ const downloadPromise = page.waitForEvent('download')
+ await page.getByTestId('gallery-item-more-dropdown-download').click()
+ await downloadPromise
+ })
+
+ //Description tab
+ await test.step('Verifies if the right text shows on the description tab', async () => {
+ await page
+ .getByTestId('gallery-item-description-neotabs')
+ .locator('[aria-controls="0-content"]')
+ .click()
+ await expect(
+ page.getByTestId('gallery-item-description-tab-content'),
+ ).toBeVisible()
+ await expect(
+ page.getByTestId('gallery-item-description-tab-content'),
+ ).toContainText('This anime waifu loves')
+ })
-test('Description tab', async ({ page }) => {
- await page.goto('/ahk/gallery/6-10')
- await page
- .getByTestId('gallery-item-description-neotabs')
- .locator('[aria-controls="0-content"]')
- .click()
- await expect(
- page.getByTestId('gallery-item-description-tab-content'),
- ).toBeVisible()
- await expect(
- page.getByTestId('gallery-item-description-tab-content'),
- ).toContainText('This anime waifu loves')
+ //Redirection
+ await test.step('Clicks on collection link on gallery item and checks redirection', async () => {
+ await page.getByTestId('gallery-item-collection-link').click()
+ await expect(page).toHaveURL('/ahk/collection/6')
+ })
})
diff --git a/tests/e2e/language.spec.ts b/tests/e2e/language.spec.ts
index fb951172d1..3af01cf79f 100644
--- a/tests/e2e/language.spec.ts
+++ b/tests/e2e/language.spec.ts
@@ -1,42 +1,50 @@
import { expect, test } from './fixtures'
-test('Check Language translations', async ({ page, Commands }) => {
+test('Translations', async ({ page, Commands }) => {
await Commands.e2elogin()
await page.goto('')
+
//DE
- await page.getByTestId('navbar-profile-dropdown').click()
- await page.getByTestId('sidebar-language').click()
- await expect(page.getByRole('menu')).toBeVisible()
- //await expect(page.getByTestId('skeleton-multiple-balances')).toHaveCount(0)
- await page.getByTestId('sidebar-language-de').click()
- await expect(
- page.getByTestId('create').filter({ has: page.getByText('Erstellen') }),
- ).toHaveCount(1)
- await expect(
- page
- .getByTestId('latest-sales')
- .filter({ has: page.getByText('Letzte Verkäufe') }),
- ).toHaveCount(1)
+ await test.step('Check German Translation', async () => {
+ await page.getByTestId('navbar-profile-dropdown').click()
+ await page.getByTestId('sidebar-language').click()
+ await expect(page.getByRole('menu')).toBeVisible()
+ await page.getByTestId('sidebar-language-de').click()
+ await expect(
+ page.getByTestId('create').filter({ has: page.getByText('Erstellen') }),
+ ).toHaveCount(1)
+ await expect(
+ page
+ .getByTestId('latest-sales')
+ .filter({ has: page.getByText('Letzte Verkäufe') }),
+ ).toHaveCount(1)
+ })
+
//FR
- await page.getByTestId('sidebar-language').click()
- await page.getByTestId('sidebar-language-fr').click()
- await expect(
- page.getByTestId('create').filter({ has: page.getByText('Créer') }),
- ).toHaveCount(1)
- await expect(
- page
- .getByTestId('latest-sales')
- .filter({ has: page.getByText('Dernières ventes') }),
- ).toHaveCount(1)
+ await test.step('Check French translation', async () => {
+ await page.getByTestId('sidebar-language').click()
+ await page.getByTestId('sidebar-language-fr').click()
+ await expect(
+ page.getByTestId('create').filter({ has: page.getByText('Créer') }),
+ ).toHaveCount(1)
+ await expect(
+ page
+ .getByTestId('latest-sales')
+ .filter({ has: page.getByText('Dernières ventes') }),
+ ).toHaveCount(1)
+ })
+
//ES
- await page.getByTestId('sidebar-language').click()
- await page.getByTestId('sidebar-language-es').click()
- await expect(
- page.getByTestId('create').filter({ has: page.getByText('Crear') }),
- ).toHaveCount(1)
- await expect(
- page
- .getByTestId('latest-sales')
- .filter({ has: page.getByText('Ventas más recientes') }),
- ).toHaveCount(1)
+ await test.step('Check Spanish translation', async () => {
+ await page.getByTestId('sidebar-language').click()
+ await page.getByTestId('sidebar-language-es').click()
+ await expect(
+ page.getByTestId('create').filter({ has: page.getByText('Crear') }),
+ ).toHaveCount(1)
+ await expect(
+ page
+ .getByTestId('latest-sales')
+ .filter({ has: page.getByText('Ventas más recientes') }),
+ ).toHaveCount(1)
+ })
})
diff --git a/tests/e2e/opengraph.ts b/tests/e2e/opengraph.ts
deleted file mode 100644
index 8974ac365b..0000000000
--- a/tests/e2e/opengraph.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-import { expect, test } from '@playwright/test'
-
-//checks collection metadata
-test('should render correct twitter opengraph on collection page', async ({
- page,
-}) => {
- await page.goto('/ahk/collection/165')
- await expect(page.locator('[property="og:site_name"]')).toHaveAttribute(
- 'content',
- 'KodaDot - Polkadot / Kusama NFT explorer',
- )
- await expect(page.locator('[property="twitter:site"]')).toHaveAttribute(
- 'content',
- '@KodaDot',
- )
- await expect(page.locator('[property="twitter:card"]')).toHaveAttribute(
- 'content',
- 'summary_large_image',
- )
- await expect(page.locator('[property="twitter:url"]')).toHaveAttribute(
- 'content',
- 'http://localhost:9090/ahk/collection/165',
- )
- await expect(page.locator('[property="twitter:title"]')).toHaveAttribute(
- 'content',
- 'Berlin (Generative) Waifus',
- )
- await expect(
- page.locator('[property="twitter:description"]'),
- ).toHaveAttribute('content', 'Amazing collection of generative AI waifus ❤️ ')
- await expect(page.locator('[property="twitter:image"]')).toHaveAttribute(
- 'content',
- 'https://og-image-green-seven.vercel.app/Berlin%20(Generative)%20Waifus.jpeg?price=Items%3A1&image=https%3A%2F%2Fimage-beta.w.kodadot.xyz%2Fipfs%2Fbafybeicaq3tyi5z3uj2oqkern656y2cqnvbu6yjmzo5b23vnilndh7kezq',
- )
-})
-
-test('Search for duplicated meta tags on collection', async ({ page }) => {
- await page.goto('/ahk/collection/165')
- await expect(page.locator('[property="og:site_name"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:site"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:card"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:url"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:title"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:description"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:image"]')).toHaveCount(1)
-})
-
-//checks Item metadata
-test('should render correct twitter opengraph on item page', async ({
- page,
-}) => {
- const waifuDescription = `Konnichiwa! I am your sweet anime waifu character generated by artificial intelligence during Berlin Blockchain Week.
- Spring is already here and even summer is getting closer.
- Let me tell you a secret about this picture:
- This spring picture that you see is a medium-shot charcoal painting of me.
- As you can see, I have rabbit ears.
-I am wearing flower t-shirt.
-The nostalgic lighting gives me more positive attitude towards life.
-`
- await page.goto('/ahk/gallery/165-2')
- await expect(page.getByTestId('metadata-link')).toHaveAttribute(
- 'href',
- 'https://image-beta.w.kodadot.xyz/ipfs/bafkreicpxyw67alyt53ql4sq5mo5vj23633igsxxyqowbui2qg4322e4wi',
- )
- await expect(page.locator('[property="og:site_name"]')).toHaveAttribute(
- 'content',
- 'KodaDot - Polkadot / Kusama NFT explorer',
- )
- await expect(page.locator('[property="twitter:site"]')).toHaveAttribute(
- 'content',
- '@KodaDot',
- )
- await expect(page.locator('[property="twitter:card"]')).toHaveAttribute(
- 'content',
- 'summary_large_image',
- )
- await expect(page.locator('[property="twitter:url"]')).toHaveAttribute(
- 'content',
- 'http://localhost:9090/ahk/gallery/165-2',
- )
- await expect(page.locator('[property="twitter:title"]')).toHaveAttribute(
- 'content',
- 'Berlin summer waifu',
- )
- await expect(
- page.locator('[property="twitter:description"]'),
- ).toHaveAttribute('content', waifuDescription)
- await expect(page.locator('[property="twitter:image"]')).toHaveAttribute(
- 'content',
- 'https://og-image-green-seven.vercel.app/Berlin%20summer%20waifu.jpeg?image=https%3A%2F%2Fimage-beta.w.kodadot.xyz%2Fipfs%2Fbafybeifjk7i2o4xycsbg2dhiciwp4idqzarhschiuimznyrj6cb77a2pry&mime=image%2Fpng',
- )
-})
-
-test('Search for duplicated meta tags on item', async ({ page }) => {
- await page.goto('/ahk/gallery/165-2')
- await expect(page.getByTestId('metadata-link')).toHaveAttribute(
- 'href',
- 'https://image-beta.w.kodadot.xyz/ipfs/bafkreicpxyw67alyt53ql4sq5mo5vj23633igsxxyqowbui2qg4322e4wi',
- )
- await expect(page.locator('[property="og:site_name"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:site"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:card"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:url"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:title"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:description"]')).toHaveCount(1)
- await expect(page.locator('[property="twitter:image"]')).toHaveCount(1)
-})
diff --git a/tests/e2e/prefix.spec.ts b/tests/e2e/prefix.spec.ts
index 471f9e415b..1db6ad3f18 100644
--- a/tests/e2e/prefix.spec.ts
+++ b/tests/e2e/prefix.spec.ts
@@ -1,32 +1,41 @@
import { expect, test } from './fixtures'
+const CHAINS = [
+ {
+ dropdownText: 'bsx',
+ chainIdText: 'bsx',
+ },
+ {
+ dropdownText: 'ahp',
+ chainIdText: 'ahp',
+ },
+ {
+ dropdownText: 'ahk',
+ chainIdText: 'ahk',
+ },
+ {
+ dropdownText: 'rmrk',
+ chainIdText: 'rmrk',
+ },
+ {
+ dropdownText: 'ksm',
+ chainIdText: 'rmrk2',
+ },
+]
+
test('Switch network', async ({ page }) => {
await page.goto('/')
await page.waitForLoadState()
- //BSX
- await page.getByTestId('chain-select').click()
- await page.getByTestId('chain-dropdown-bsx').click()
- await expect(page.getByTestId('chain')).toHaveText('bsx')
- //AHP
- await page.getByTestId('chain-select').click()
- await page.getByTestId('chain-dropdown-ahp').click()
- await expect(page.getByTestId('chain')).toHaveText('ahp')
- //AHK
- await page.getByTestId('chain-select').click()
- await page.getByTestId('chain-dropdown-ahk').click()
- await expect(page.getByTestId('chain')).toHaveText('ahk')
- //RMRK2
- await page.getByTestId('chain-select').click()
- await page.getByTestId('chain-dropdown-ksm').click()
- await expect(page.getByTestId('chain')).toHaveText('rmrk2')
- //RMRK1
- await page.getByTestId('chain-select').click()
- await page.getByTestId('chain-dropdown-rmrk').click()
- await expect(page.getByTestId('chain')).toHaveText('rmrk')
+ for (const data of CHAINS) {
+ await test.step(`Switching to ${data.chainIdText}`, async () => {
+ await page.getByTestId('chain-select').click()
+ await page.getByTestId(`chain-dropdown-${data.dropdownText}`).click()
+ await expect(page.getByTestId('chain')).toHaveText(data.chainIdText)
+ })
+ }
})
test('Check if RMRK2 NFT URL is correct', async ({ page }) => {
- //RMRK2
await page.goto('/ksm/explore/items?listed=false&search=Spirit+Key+%232112')
await page.locator('[class="infinite-scroll-item"]').click()
await expect(page).toHaveURL(
@@ -35,7 +44,6 @@ test('Check if RMRK2 NFT URL is correct', async ({ page }) => {
})
test('Check if Ahk NFT URL is correct', async ({ page }) => {
- //AHK
await page.goto('/ahk/explore/items?listed=false&search=Susanne')
await page.locator('[class="infinite-scroll-item"]').click()
await expect(page).toHaveURL('/ahk/gallery/111-2')
diff --git a/tests/e2e/profile.spec.ts b/tests/e2e/profile.spec.ts
index 14f334cfb0..f0c42d54ff 100644
--- a/tests/e2e/profile.spec.ts
+++ b/tests/e2e/profile.spec.ts
@@ -1,9 +1,11 @@
import { expect, test } from './fixtures'
+const KSM_TEST_ADDRESS = 'CmWHiv7h4m9tEzKD94DH4mqwGTvsdYQe2nouWPF7ipmHpqA'
+
test('Profile Interactions', async ({ page, Commands }) => {
- const testAddress = 'CmWHiv7h4m9tEzKD94DH4mqwGTvsdYQe2nouWPF7ipmHpqA'
- await page.goto(`ahk/u/${testAddress}?tab=owned`)
+ await page.goto(`ahk/u/${KSM_TEST_ADDRESS}?tab=owned`)
await Commands.scrollDownSlow()
+
//test step - will check if buy now has items that are not listed
await test.step('Buy Now', async () => {
await Commands.acceptCookies()
@@ -13,7 +15,8 @@ test('Profile Interactions', async ({ page, Commands }) => {
await expect(li.getByText('KSM')).toBeVisible()
}
})
- //test step
+
+ //Activity
await test.step('Activity Tab', async () => {
await page.getByTestId('profile-tabs').last().click()
//usually sale and buy are active when you enter the page
@@ -52,14 +55,15 @@ test('Profile Interactions', async ({ page, Commands }) => {
//ALL
await page.getByTestId('profile-activity-button-all').click()
})
- //test step
+
+ //PROFILE LINKS
await test.step('Profile Links', async () => {
//copy address
await page
.getByTestId('profile-identity-buttons')
.getByText('Copy Address')
.click()
- await Commands.copyText(testAddress)
+ await Commands.copyText(KSM_TEST_ADDRESS)
//QR Code
await page
.getByTestId('profile-identity-buttons')
@@ -73,7 +77,7 @@ test('Profile Interactions', async ({ page, Commands }) => {
.getByText('Transfer')
.click()
await expect(page).toHaveURL(
- `/ahk/transfer?target=${testAddress}&usdamount=10&donation=true`,
+ `/ahk/transfer?target=${KSM_TEST_ADDRESS}&usdamount=10&donation=true`,
)
})
})
diff --git a/tests/e2e/redirect.spec.ts b/tests/e2e/redirect.spec.ts
index 9a50bc6ed3..9a34c3b632 100644
--- a/tests/e2e/redirect.spec.ts
+++ b/tests/e2e/redirect.spec.ts
@@ -1,17 +1,37 @@
import { expect, test } from './fixtures'
-test('Should redirect from rmrk2 prefix to ksm', async ({ page }) => {
- await page.goto(
- '/rmrk2/gallery/17842583-22708b368d163c8007-CITY-LOWER_ART_DISTRICT-00000006',
- )
- // expects gallery redirection to occur
- await expect(page).toHaveURL(
- '/ksm/gallery/17842583-22708b368d163c8007-CITY-LOWER_ART_DISTRICT-00000006',
- )
+test('Redirections', async ({ page }) => {
+ //Gallery
+ await test.step('Expect gallery Item url to be properly redirected', async () => {
+ await page.goto(
+ '/rmrk2/gallery/17842583-22708b368d163c8007-CITY-LOWER_ART_DISTRICT-00000006',
+ )
+ await expect(page).toHaveURL(
+ '/ksm/gallery/17842583-22708b368d163c8007-CITY-LOWER_ART_DISTRICT-00000006',
+ )
+ })
- await page.goto('/rmrk2/explore/items?listed=true&sort=updatedAt_DESC')
- // expects item redirection to occur
- await expect(page).toHaveURL(
- '/ksm/explore/items?listed=true&sort=updatedAt_DESC',
- )
+ //Explore Collections
+ await test.step('Expect Explore url to be properly redirected', async () => {
+ await page.goto('/ksm/explore/collections')
+ await expect(page).toHaveURL('/ksm/explore/collectibles')
+ })
+
+ //Collection
+ await test.step('Expect collection url to be properly redirected', async () => {
+ await page.goto('/ahk/explore/gallery')
+ await expect(page).toHaveURL('/ahk/explore/items')
+ })
+
+ //Statemine
+ await test.step('Expect url with stmn to be properly redirected', async () => {
+ await page.goto('/stmn/explore/items')
+ await expect(page).toHaveURL('/ahk/explore/items')
+ })
+
+ //Transfer
+ await test.step('Expect collection that has /transfer', async () => {
+ await page.goto('/transfer')
+ await expect(page).toHaveURL('/ksm/transfer')
+ })
})
diff --git a/tests/e2e/search.spec.ts b/tests/e2e/search.spec.ts
index 27cc50345d..e682858ac3 100644
--- a/tests/e2e/search.spec.ts
+++ b/tests/e2e/search.spec.ts
@@ -1,41 +1,40 @@
import { expect, test } from './fixtures'
-function imagesHaveLoaded() {
- return Array.from(document.images).every((i) => i.complete)
-}
+const LANDING_PATH = '/ksm'
test('Check if search provide results', async ({ page }) => {
- //page.route('**', route => route.continue())
- await page.goto('/ksm')
- const searchBar = page.getByTestId('search-bar')
- await searchBar.locator('input').fill('waifu')
- await page.locator('.search-suggestion-container').hover()
- /* await Promise.all([
- page.waitForResponse(
- (resp) =>
- resp
- .url()
- .includes(
- 'bafybeidqnzwlm5hvik7thsenuziurlnlkcfxuafbu2nfrqgcu4ladr2zhu'
- ) && resp.status() === 302
- ),
- ]) */
+ await page.goto(LANDING_PATH)
+
+ //Search term
+ await test.step('Search for the term Waifu and hover over results', async () => {
+ const searchBar = page.getByTestId('search-bar')
+ await searchBar.locator('input').fill('waifu')
+ await page.locator('.search-suggestion-container').hover()
+ })
+
//check contents of Collection Tab
- const tabCollection = page.getByTestId('collection-tab')
- await expect(tabCollection.locator('.neo-skeleton-item').first()).toBeVisible(
- { timeout: 30000 },
- )
- await expect(
- tabCollection.locator('.search-result-item').first(),
- ).toBeVisible({ timeout: 30000 })
- await expect(tabCollection.locator('.link-item').first()).toBeVisible({
- timeout: 30000,
+ await test.step('Switches to Collection tab and wait for results to load', async () => {
+ const tabCollection = page.getByTestId('collection-tab')
+ await expect(
+ tabCollection.locator('.neo-skeleton-item').first(),
+ ).not.toBeVisible({ timeout: 30000 })
+ await expect(
+ tabCollection.locator('.search-result-item').first(),
+ ).toBeVisible({ timeout: 30000 })
+ await expect(tabCollection.locator('.link-item').first()).toBeVisible({
+ timeout: 30000,
+ })
})
- await page.waitForFunction(imagesHaveLoaded, { timeout: 30000 })
- //switchs and check NFT results
- await page.locator('div[aria-controls="NFTs-content"]').click()
- const tabNft = page.getByTestId('nft-tab')
- await expect(tabNft.locator('.search-result-item').first()).toBeVisible({
- timeout: 30000,
+
+ //Switchs to NFT tab
+ await test.step('Switches to NFT tab and wait for results to load', async () => {
+ await page.locator('div[aria-controls="NFTs-content"]').click()
+ const tabNft = page.getByTestId('nft-tab')
+ await expect(tabNft.locator('.neo-skeleton-item').first()).not.toBeVisible({
+ timeout: 30000,
+ })
+ await expect(tabNft.locator('.search-result-item').first()).toBeVisible({
+ timeout: 30000,
+ })
})
})
diff --git a/tests/e2e/settings.spec.ts b/tests/e2e/settings.spec.ts
index f09c357731..cb7cc9d25e 100644
--- a/tests/e2e/settings.spec.ts
+++ b/tests/e2e/settings.spec.ts
@@ -1,8 +1,10 @@
import { expect, test } from './fixtures'
+const LANDING_PATH = '/ahk'
+
test('Settings', async ({ page, Commands }) => {
await Commands.e2elogin()
- await page.goto('/ahk')
+ await page.goto(LANDING_PATH)
//click on settings and check if page redirects correctly
await page.getByTestId('navbar-profile-dropdown').click()
await page.getByTestId('sidebar-link-settings').click()
diff --git a/tests/e2e/share.spec.ts b/tests/e2e/share.spec.ts
new file mode 100644
index 0000000000..546f55d62c
--- /dev/null
+++ b/tests/e2e/share.spec.ts
@@ -0,0 +1,62 @@
+import { expect, test } from './fixtures'
+
+const ITEM_ADDRESS_PATH = '/ahk/gallery/6-10'
+const COLLECTION_ADDRESS_PATH = '/ahp/collection/38/'
+
+test('Share Button on Gallery Item', async ({ page, Commands }) => {
+ await page.goto(ITEM_ADDRESS_PATH)
+ const shareBtn = page.getByTestId('gallery-item-share-button')
+
+ //Copy Link
+ await test.step('Clicks on copy link and verifies clipboard', async () => {
+ await shareBtn.click()
+ await shareBtn.getByText('Copy Link').click()
+ const clipboardText1 = await page.evaluate('navigator.clipboard.readText()')
+ expect(clipboardText1).toContain('/ahk/gallery/6-10')
+ })
+
+ //Twitter
+ await test.step('Clicks on twitter and verify URL', async () => {
+ await shareBtn.click()
+ await Commands.checkNewTab(
+ 'https://twitter.com',
+ await shareBtn.getByTestId('gallery-item-share-dropdown-twitter').click(),
+ )
+ })
+
+ //QR Code
+ await test.step('Clicks on QR code and verify its existance', async () => {
+ await shareBtn.click()
+ await shareBtn.getByText('QR Code').click()
+ await expect(
+ page.getByTestId('gallery-item-share-dropdown-qrcode'),
+ ).toBeVisible()
+ await page.keyboard.press('Escape')
+ })
+})
+
+test('Share Button on Collection', async ({ page, Commands }) => {
+ await page.goto(COLLECTION_ADDRESS_PATH)
+ const shareBtn = page.getByTestId('share-button').first()
+ await test.step('Share button functionality', async () => {
+ //Copy
+ await shareBtn.click()
+ await page.getByTestId('hero-copy-link-dropdown').first().click()
+ await Commands.copyText('http://localhost:9090/ahp/collection/38')
+ })
+ //QR
+ await test.step('Clicks on QR code and verify its existance', async () => {
+ await shareBtn.click()
+ await page.getByTestId('hero-share-QR-dropdown').first().click()
+ await expect(page.getByTestId('hero-share-qrcode-modal')).toBeVisible()
+ await page.keyboard.press('Escape')
+ })
+ //Twitter
+ await test.step('Clicks on twitter and verify URL', async () => {
+ await shareBtn.click()
+ await Commands.checkNewTab(
+ 'https://twitter.com',
+ await page.getByTestId('hero-share-twitter-dropdown').first().click(),
+ )
+ })
+})
diff --git a/tests/e2e/sidebar.spec.ts b/tests/e2e/sidebar.spec.ts
index 1ba4ff83f6..0ba44c6423 100644
--- a/tests/e2e/sidebar.spec.ts
+++ b/tests/e2e/sidebar.spec.ts
@@ -1,9 +1,13 @@
import { expect, test } from './fixtures'
-test('Sidebar Interactions', async ({ page, Commands }) => {
+const LANDING_PATH = '/ahk'
+
+test('Switches trough sidebars and check if they overlap each other', async ({
+ page,
+ Commands,
+}) => {
await Commands.e2elogin()
- await page.goto('/ahk')
- //checks if sidebar closes when clicking another sidebar
+ await page.goto(LANDING_PATH)
//profile
await page.getByTestId('navbar-profile-dropdown').click()
await expect(page.getByTestId('sidebar-wallet-container')).toBeVisible()
diff --git a/tests/e2e/transfer.spec.ts b/tests/e2e/transfer.spec.ts
index 723cd06e31..a298f9a433 100644
--- a/tests/e2e/transfer.spec.ts
+++ b/tests/e2e/transfer.spec.ts
@@ -1,83 +1,102 @@
import { expect, test } from './fixtures'
+const TRANSFER_PATH = '/dot/transfer'
+
test('Transfer Page Functionality', async ({ page, Commands }) => {
await Commands.e2elogin()
- await page.goto('/dot/transfer')
- const UserAddress = await page
- .getByTestId('avatar-identity-icon')
- .getAttribute('data-key')
- await page.getByTestId('transfer-copy-sender-address').click()
- await Commands.copyText(`${UserAddress}`)
- await page
- .getByPlaceholder('Enter wallet address')
- .fill('0xwer6544443653444422')
- await expect(page.getByTestId('addresschecker-infobox-invalid')).toBeVisible()
+ await page.goto(TRANSFER_PATH)
+
+ const UserAddress =
+ await test.step('Gets user address via attribute', async () => {
+ const UserAddress = await page
+ .getByTestId('avatar-identity-icon')
+ .getAttribute('data-key')
+ return UserAddress
+ })
+
+ //Copy address
+ await test.step('Copy user address and verifies clipboard content', async () => {
+ await page.getByTestId('transfer-copy-sender-address').click()
+ await Commands.copyText(`${UserAddress}`)
+ })
+
+ //Wrong address format
+ await test.step('Inserts invalid address and verifies if error message appears', async () => {
+ await page.getByTestId('global-address-input').fill('0xwer6544443653444422')
+ await expect(
+ page.getByTestId('addresschecker-infobox-invalid'),
+ ).toBeVisible()
+ })
+
+ //Fill form
await test.step('Add and Fill input recipients', async () => {
- await page
- .getByPlaceholder('Enter wallet address')
- .nth(0)
- .fill(`${UserAddress}`)
+ await page.getByTestId('global-address-input').nth(0).fill(`${UserAddress}`)
await page.getByTestId('transfer-input-amount-token').nth(0).fill('1')
//add recipient
await page.getByTestId('transfer-icon-add-recipient').click()
//fill polkadot Address and amount on last field
- await page
- .getByPlaceholder('Enter wallet address')
- .nth(1)
- .fill(`${UserAddress}`)
+ await page.getByTestId('global-address-input').nth(1).fill(`${UserAddress}`)
await page.getByTestId('transfer-input-amount-token').nth(1).fill('5')
})
- //triggers switch to send same amount
- await page.getByTestId('transfer-switch-same').click()
- //checks if second address input converted itself according to same amount switch
- await expect(
- page.getByTestId('transfer-input-amount-token').nth(1),
- ).toHaveValue('1')
+
+ //Send same amount Switch
+ await test.step('Enables same amount switch and verifies its content', async () => {
+ await page.getByTestId('transfer-switch-same').click()
+ //checks if second address input converted itself according to same amount switch
+ await expect(
+ page.getByTestId('transfer-input-amount-token').nth(1),
+ ).toHaveValue('1')
+ })
+
await test.step('Test if total sums up', async () => {
const total = (
await page.getByTestId('transfer-total-amount').innerText()
).valueOf()
const totalNumber = +total.split(' ')[0]
expect(totalNumber).toBeGreaterThan(0)
- await test.step('Recurring Payment Button', async () => {
- await page.getByTestId('transfer-tab-usd').click()
- await page.getByTestId('transfer-input-amount-usd').nth(0).fill('5')
- await page.getByTestId('transfer-button-options').click()
- await page.getByTestId('transfer-dropdown-recurring').click()
- Commands.copyText(
- `http://localhost:9090/dot/transfer?target=${UserAddress}&target1=${UserAddress}&usdamount=5`,
- )
- })
- //removes last transfer recipient
- await page.getByTestId('transfer-remove-recipient').last().click()
- await test.step('Pay me Button', async () => {
- await page.getByTestId('transfer-input-amount-usd').fill('4')
- await page.getByTestId('transfer-button-options').click()
- await page.getByTestId('transfer-dropdown-pay-me').click()
- Commands.copyText(
- `http://localhost:9090/dot/transfer?target=${UserAddress}&usdamount=4`,
- )
- })
- //verify if network fee is present
- await expect(page.getByTestId('transfer-network-fee')).toBeVisible()
- //last step
- await test.step('Switch to KSM and convert address to proper chain', async () => {
- //change to KSM chain
- await page
- .getByTestId('transfer-token-tabs-container')
- .getByText('KSM')
- .click()
- await page
- .getByPlaceholder('Enter wallet address')
- .nth(0)
- .fill(`${UserAddress}`)
- await expect(
- page.getByTestId('addresschecker-infobox-invalid'),
- ).toBeVisible()
- await page.getByTestId('addresschecker-button-change-to').click()
- await expect(
- page.getByTestId('addresschecker-infobox-convertion-success'),
- ).toBeVisible()
- })
+ })
+
+ //Recurring payment
+ await test.step('Switchs to USD tab, fill inputs and verifies if total sums up', async () => {
+ await page.getByTestId('transfer-tab-usd').click()
+ await page.getByTestId('transfer-input-amount-usd').nth(0).fill('5')
+ await page.getByTestId('transfer-button-options').click()
+ await page.getByTestId('transfer-dropdown-recurring').click()
+ Commands.copyText(
+ `http://localhost:9090/dot/transfer?target=${UserAddress}&target1=${UserAddress}&usdamount=5`,
+ )
+ })
+
+ //removes last transfer recipient
+ await page.getByTestId('transfer-remove-recipient').last().click()
+
+ //Pay me
+ await test.step('Verifies if pay me button provides correct clipboard format', async () => {
+ await page.getByTestId('transfer-input-amount-usd').fill('4')
+ await page.getByTestId('transfer-button-options').click()
+ await page.getByTestId('transfer-dropdown-pay-me').click()
+ Commands.copyText(
+ `http://localhost:9090/dot/transfer?target=${UserAddress}&usdamount=4`,
+ )
+ })
+
+ //verify if network fee is present
+ await expect(page.getByTestId('transfer-network-fee')).toBeVisible()
+
+ //Address conversion
+ await test.step('Switch to KSM and convert address to proper chain', async () => {
+ //change to KSM chain
+ await page
+ .getByTestId('transfer-token-tabs-container')
+ .getByText('KSM')
+ .click()
+ await page.getByTestId('global-address-input').nth(0).fill(`${UserAddress}`)
+ await expect(
+ page.getByTestId('addresschecker-infobox-invalid'),
+ ).toBeVisible()
+ await page.getByTestId('addresschecker-button-change-to').click()
+ await expect(
+ page.getByTestId('addresschecker-infobox-convertion-success'),
+ ).toBeVisible()
})
})
diff --git a/tests/transactionMintStatemine.spec.ts b/tests/transactionMintStatemine.spec.ts
index 023664e526..1b8fbc08b8 100644
--- a/tests/transactionMintStatemine.spec.ts
+++ b/tests/transactionMintStatemine.spec.ts
@@ -1,9 +1,7 @@
-import {
- assignIds,
- prepTokens,
-} from '@/composables/transaction/mintToken/transactionMintStatemine'
+import { expandCopiesWithsIds } from '@/composables/transaction/mintToken/transactionMintStatemine'
import { TokenToMint } from '@/composables/transaction/types'
import {
+ assignIds,
copiesToMint,
expandCopies,
} from '@/composables/transaction/mintToken/utils'
@@ -24,7 +22,7 @@ describe('transactionMintStatemine.ts functions', () => {
const tokens: TokenToMint[] = [
{ selectedCollection: { lastIndexUsed: 4 } },
]
- const result = assignIds(tokens)
+ const result = assignIds(tokens, 4)
expect(result).toEqual([
{ selectedCollection: { lastIndexUsed: 4 }, id: 5 },
])
@@ -36,7 +34,7 @@ describe('transactionMintStatemine.ts functions', () => {
{ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 2 } },
{ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 2 } },
]
- const result = assignIds(tokens)
+ const result = assignIds(tokens, 2)
expect(result).toEqual([
{ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 2 }, id: 3 },
{ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 2 }, id: 4 },
@@ -243,7 +241,7 @@ describe('transactionMintStatemine.ts functions', () => {
expect(result[2].name).toBe('test')
})
})
- describe('prepTokens function', () => {
+ describe('expandCopiesWithsIds function', () => {
it('should correctly prepare a single token with unique id', async () => {
const token: TokenToMint = {
name: 'test',
@@ -254,7 +252,7 @@ describe('transactionMintStatemine.ts functions', () => {
token,
}
- const result = await prepTokens(item, MOCK_API)
+ const result = await expandCopiesWithsIds(item, MOCK_API)
const expectedResult = [
{
@@ -278,7 +276,7 @@ describe('transactionMintStatemine.ts functions', () => {
token,
}
- const result = await prepTokens(item, MOCK_API)
+ const result = await expandCopiesWithsIds(item, MOCK_API)
const expectedResult = [
{
@@ -311,15 +309,15 @@ describe('transactionMintStatemine.ts functions', () => {
const tokens: TokenToMint[] = [
{
name: 'test1',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
},
{
name: 'test2',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
},
{
name: 'test3',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
},
]
@@ -327,22 +325,22 @@ describe('transactionMintStatemine.ts functions', () => {
token: tokens,
}
- const result = await prepTokens(item, MOCK_API)
+ const result = await expandCopiesWithsIds(item, MOCK_API)
const expectedResult = [
{
name: 'test1',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
id: 4,
},
{
name: 'test2',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
id: 5,
},
{
name: 'test3',
- selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3 },
+ selectedCollection: { alreadyMinted: 2, lastIndexUsed: 3, id: 1234 },
id: 6,
},
]
@@ -351,22 +349,27 @@ describe('transactionMintStatemine.ts functions', () => {
})
it('should correctly prepare an array of tokens with unique ids and some have copies', async () => {
+ const selectedCollection = {
+ alreadyMinted: 6,
+ lastIndexUsed: 7,
+ id: 1234,
+ }
const tokens: TokenToMint[] = [
{
name: 'test1',
copies: 2,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
},
{
name: 'test2',
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
},
{
name: 'test3',
copies: 3,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
},
]
@@ -374,47 +377,47 @@ describe('transactionMintStatemine.ts functions', () => {
token: tokens,
}
- const result = await prepTokens(item, MOCK_API)
+ const result = await expandCopiesWithsIds(item, MOCK_API)
const expectedResult = [
{
name: 'test1 #1',
copies: 2,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 8,
},
{
name: 'test1 #2',
copies: 2,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 9,
},
{
name: 'test2',
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 10,
},
{
name: 'test3 #1',
copies: 3,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 11,
},
{
name: 'test3 #2',
copies: 3,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 12,
},
{
name: 'test3 #3',
copies: 3,
postfix: true,
- selectedCollection: { alreadyMinted: 6, lastIndexUsed: 7 },
+ selectedCollection,
id: 13,
},
]
diff --git a/utils/calculation.ts b/utils/calculation.ts
index 836da19cb7..d0809358f8 100644
--- a/utils/calculation.ts
+++ b/utils/calculation.ts
@@ -6,7 +6,7 @@ export function calculateExactUsdFromToken(
token: number,
price: number,
): number {
- return Number((token * price).toFixed(2))
+ return Number((token * price).toFixed(1))
}
export function calculateTokenFromUsd(tokenPrice: number, usd: number): number {
diff --git a/utils/carousel.ts b/utils/carousel.ts
index bf01a73311..9d43915679 100644
--- a/utils/carousel.ts
+++ b/utils/carousel.ts
@@ -18,7 +18,7 @@ export const formatNFT = (nfts, chain?: string): CarouselNFT[] => {
return data.map((nft) => {
const timestamp = nft.updatedAt || nft.timestamp
const metaImage =
- nft.meta.image || nft.resources?.[0].thumb || nft.resources?.[0].src
+ nft.meta.image || nft.resources?.[0]?.thumb || nft.resources?.[0]?.src
const metaAnimationUrl = nft.meta.animationUrl
const name = nft.name || nft.meta.name
diff --git a/utils/constants.ts b/utils/constants.ts
index 947bfad9da..d7f12decc1 100644
--- a/utils/constants.ts
+++ b/utils/constants.ts
@@ -63,6 +63,7 @@ export const URLS = {
search: 'https://polysearch.w.kodadot.xyz',
baseUrl: 'https://kodadot.xyz',
newsletter: 'https://newsletter.w.kodadot.xyz',
+ counter: 'https://counter.kodadot.workers.dev',
},
providers: {
coingecko: 'https://api.coingecko.com/api/v3',
diff --git a/utils/teleport.ts b/utils/teleport.ts
index 44b19f9e7e..af0f58bde9 100644
--- a/utils/teleport.ts
+++ b/utils/teleport.ts
@@ -49,6 +49,7 @@ export type TeleportTransition = {
amountFormatted: string
amountUsd: string
token: string
+ txFees: number
}
export const allowedTransitions = {