Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸŽ‰ STATEMINE Version Zero #5932

Closed
wants to merge 51 commits into from
Closed

πŸŽ‰ STATEMINE Version Zero #5932

wants to merge 51 commits into from

Conversation

vikiival
Copy link
Member

@vikiival vikiival commented May 11, 2023

  • 🚚 rename statemine to stmn
  • 🚚 rename statemine to stmn
  • πŸŽ‰ stmn in the house
  • πŸ› statemine not properly defined
  • ⚰️ old code
  • ⚑ nicer organization of landing page
  • πŸŽ‰ statemine
  • ⚑ enable create on stmn
  • πŸ”§ apollo endpoints
  • πŸ—‘οΈ deduped code via static
  • πŸ”§ statemine endpoints
  • πŸ› fixed imports for statick
  • πŸ› stmn was pointing to subqueries
  • :zao: isSnek
  • πŸ› fixed value of ksm
  • πŸ› very strange symbols
  • 🚧 WIP minting
  • ⚑ enable buy on statemine
  • πŸ› nft bought is too soon, close Congratulations pop-up appeared too soonΒ #5622
  • πŸ› try/catch/finally
  • ⚑ buy for statemine
  • ⚑ uniqes
  • πŸ’₯ take url by prefix
  • πŸ› need to pass empty whitelist as undefined
  • ✨ list
  • πŸ”‡ logs because i had inconsistent connection
  • ✨ send
  • 🧹 organize imports
  • 🀷 may burn works
  • ⚑ disable minting on statemine
  • :sprakles: exec mint Statemine
  • πŸ› did not set metadata
  • πŸ› expected String got Undefined
  • ✨ create collection
  • πŸ§‘β€πŸ’» one v-if for whole landing page

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

πŸ‘‡ __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Integration of statemine:

What should you know

We have of course new indexer called stick

We are missing minting (on-chain code is there and I started to rewrite it with new design)

Screenshot πŸ“Έ

  • My fix has changed something on UI; a screenshot is best to understand changes for others.
Screenshot 2023-05-11 at 19 53 25

Screenshot 2023-05-11 at 22 44 21

Copilot Summary

πŸ€– Generated by Copilot at baa480b

Added support for Statemine chain and its features, such as creating and buying NFTs, to the gallery. Updated various components, composables, and static files to handle Statemine transactions and data. Added new components and files for the Statemine create feature. Fixed some minor issues and improved code style and readability.

πŸ€– Generated by Copilot at baa480b

Sing, O Muse, of the valiant deeds of the gallery heroes,
Who ventured to the realm of Statemine, the chain of many tokens,
And there they wrought with skill and craft new collections and NFTs,
Using CreateCollection and CreateNft, the components of minting.

vikiival added 30 commits May 8, 2023 14:48
# Conflicts:
#	package.json
#	pnpm-lock.yaml
# Conflicts:
#	utils/prefix.ts
#	utils/queryPathResolver.ts
# Conflicts:
#	libs/static/src/endpoints.ts
#	utils/chain.ts
@@ -50,4 +54,13 @@ export function execListTx(item: ActionList, api, executeTransaction) {
errorMessage: item.errorMessage,
})
}

if (item.urlPrefix === 'stmn') {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

]

export const chainInfo = {
export const chainInfo: Record<Prefix, string> = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 3 locations. Consider refactoring.

return token === 'KSM' ? depositInKSM : ksmToBsx(depositInKSM)
}

export const getFeesToken = async (): Promise<Token> => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

@reviewpad reviewpad bot added large Pull request is large waiting-for-review labels May 11, 2023
@vikiival
Copy link
Member Author

Did I found some funny bug?

Screenshot 2023-05-11 at 22 49 42

components/stmn/Create/CreateCollection.vue Show resolved Hide resolved
components/stmn/Create/utils.ts Outdated Show resolved Hide resolved
components/stmn/input/TokenBalanceInput.vue Outdated Show resolved Hide resolved
store/assets.ts Outdated Show resolved Hide resolved
@@ -0,0 +1,7 @@
<template>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who's this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder for new create design

components/stmn/input/OfferBalanceInput.vue Outdated Show resolved Hide resolved
components/stmn/Create/utils.ts Outdated Show resolved Hide resolved

watch(newCollectionId, (id) => {
if (id) {
executeTransaction({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 6 locations. Consider refactoring.


const args = [[create, meta, ...list]]

executeTransaction({
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 6 locations. Consider refactoring.

import { constructMeta } from './constructMeta'
import { useNewCollectionId } from './useNewCollectionId'

export async function execMintCollectionStatemine(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function execMintCollectionStatemine has 29 lines of code (exceeds 25 allowed). Consider refactoring.

store/assets.ts Outdated Show resolved Hide resolved
import type { ActionMintToken, MintedCollectionBasilisk } from '../types'
import { constructMeta } from './constructMeta'

export async function execMintStatemine(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function execMintStatemine has 31 lines of code (exceeds 25 allowed). Consider refactoring.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's about this πŸ‘€

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5653 lines exceeds the maximum allowed for the inline comments feature.

@vikiival
Copy link
Member Author

@kodadot/internal-dev any ideas why it does not build? πŸ₯Ί

@socket-security
Copy link

socket-security bot commented May 12, 2023

No dependency changes detected. Learn more about Socket for GitHub β†—οΈŽ


πŸ‘ No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Pull request alert summary
Issue Status
Install scripts βœ… 0 issues
Native code βœ… 0 issues
Bin script shell injection βœ… 0 issues
Unresolved require βœ… 0 issues
Invalid package.json βœ… 0 issues
HTTP dependency βœ… 0 issues
Git dependency βœ… 0 issues
Potential typo squat βœ… 0 issues
Known Malware βœ… 0 issues
Telemetry βœ… 0 issues
Protestware/Troll package βœ… 0 issues

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5653 lines exceeds the maximum allowed for the inline comments feature.

@roiLeo
Copy link
Contributor

roiLeo commented May 12, 2023

@kodadot/internal-dev any ideas why it does not build? πŸ₯Ί

maybe comming from your push of pnpm-lock.yaml file, have you try to run build command on local? try to clear node_modules and reinstall

@yangwao
Copy link
Member

yangwao commented May 12, 2023

try your luck and update to pnpm8

Bike Fall

@roiLeo
Copy link
Contributor

roiLeo commented May 12, 2023

Build OK on my side

βœ” Generated public dist                                                                                                                                           nitro 12:24:37
β„Ή Initializing prerenderer                                                                                                                                        nitro 12:24:37
β„Ή Prerendering 47 initial routes with crawler                                                                                                                     nitro 12:24:38
  β”œβ”€ / (24ms)                                                                                                                                                     nitro 12:24:38
  β”œβ”€ /200 (2ms)                                                                                                                                                   nitro 12:24:38
  β”œβ”€ /404 (1ms)                                                                                                                                                   nitro 12:24:38
  β”œβ”€ /about (1ms)                                                                                                                                                 nitro 12:24:38
  β”œβ”€ /carbonless (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /contribute (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /e2e-login (1ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /error (2ms)                                                                                                                                                 nitro 12:24:38
  β”œβ”€ /esCarbonless (1ms)                                                                                                                                          nitro 12:24:38
  β”œβ”€ /esSustainability (4ms)                                                                                                                                      nitro 12:24:38
  β”œβ”€ /first-time (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /hot (1ms)                                                                                                                                                   nitro 12:24:38
  β”œβ”€ /identity (1ms)                                                                                                                                              nitro 12:24:38
  β”œβ”€ /jobs (1ms)                                                                                                                                                  nitro 12:24:38
  β”œβ”€ /partnership (1ms)                                                                                                                                           nitro 12:24:38
  β”œβ”€ /qrCode (0ms)                                                                                                                                                nitro 12:24:38
  β”œβ”€ /sales (1ms)                                                                                                                                                 nitro 12:24:38
  β”œβ”€ /series-insight (1ms)                                                                                                                                        nitro 12:24:38
  β”œβ”€ /settings (2ms)                                                                                                                                              nitro 12:24:38
  β”œβ”€ /spotlight (0ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /sustainability (1ms)                                                                                                                                        nitro 12:24:38
  β”œβ”€ /teleport (1ms)                                                                                                                                              nitro 12:24:38
  β”œβ”€ /teleport-bridge (0ms)                                                                                                                                       nitro 12:24:38
  β”œβ”€ /transfer (1ms)                                                                                                                                              nitro 12:24:38
  β”œβ”€ /transform (3ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /tutorials (1ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /bsx/assets (0ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /bsx/claim (1ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /bsx/create (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /bsx/incomingOffers (0ms)                                                                                                                                    nitro 12:24:38
  β”œβ”€ /bsx/offers (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /bsx/stats (1ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /bsx/waifu (0ms)                                                                                                                                             nitro 12:24:38
  β”œβ”€ /ksm/create (1ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /rmrk/admin (0ms)                                                                                                                                            nitro 12:24:38
  β”œβ”€ /rmrk/create (1ms)                                                                                                                                           nitro 12:24:38
  β”œβ”€ /rmrk/credit (1ms)                                                                                                                                           nitro 12:24:39
  β”œβ”€ /rmrk/mint (1ms)                                                                                                                                             nitro 12:24:39
  β”œβ”€ /snek/assets (1ms)                                                                                                                                           nitro 12:24:39
  β”œβ”€ /snek/claim (1ms)                                                                                                                                            nitro 12:24:39
  β”œβ”€ /snek/create (0ms)                                                                                                                                           nitro 12:24:39
  β”œβ”€ /snek/incomingOffers (2ms)                                                                                                                                   nitro 12:24:39
  β”œβ”€ /snek/offers (1ms)                                                                                                                                           nitro 12:24:39
  β”œβ”€ /snek/stats (1ms)                                                                                                                                            nitro 12:24:39
  β”œβ”€ /snek/waifu (0ms)                                                                                                                                            nitro 12:24:39
  β”œβ”€ /stmn/create/collection (1ms)                                                                                                                                nitro 12:24:39
  β”œβ”€ /stmn/create/item (0ms)                                                                                                                                      nitro 12:24:39
βœ” You can now deploy dist to any static hosting!

@vikiival
Copy link
Member Author

prepare: [error] Cannot find module '/home/runner/work/nft-gallery/nft-gallery/node_modules/@kodadot1/static/dist/index.cjs'

Loooks like nft-gallery is two times there, but I do not know how it appeared there

@codeclimate
Copy link

codeclimate bot commented May 12, 2023

Code Climate has analyzed commit 7f7cad9 and detected 10 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Duplication 7

View more on Code Climate.

@vikiival vikiival closed this May 12, 2023
@vikiival vikiival deleted the stmn-version-zero branch May 12, 2023 10:47
@vikiival
Copy link
Member Author

continue in #5935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large Pull request is large waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding Statemine into the chain selector Congratulations pop-up appeared too soon
3 participants