-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
refactor: remove minimark #11448
base: main
Are you sure you want to change the base?
refactor: remove minimark #11448
Conversation
WalkthroughThis update refactors numerous components, composables, and utilities to change the source of the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TX_Burn as execBurnCollection
participant CollectionService
User->>TX_Burn: Initiate burn transaction (with specific URL prefix)
alt Prefix is "ahk" or "ahp"
TX_Burn->>CollectionService: Retrieve collection data
TX_Burn->>TX_Burn: Construct witness argument
else Other prefixes (e.g. "rmrk", "ksm")
TX_Burn->>TX_Burn: Skip removed interaction handling
end
TX_Burn->>User: Return transaction result
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (19)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for polkadot ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for koda-canary ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is obfuscated code?Obfuscated files are intentionally packed to hide their behavior. This could be a sign of malware. Packages should not obfuscate their code. Consider not using packages with obfuscated code. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Deploying koda-art-prod with
|
Latest commit: |
6cea232
|
Status: | ✅ Deploy successful! |
Preview URL: | https://a3116206.kodaart-production.pages.dev |
Branch Preview URL: | https://refactor--remove-minimark.kodaart-production.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
composables/useTransaction.ts (1)
215-215
: 🛠️ Refactor suggestionConsider handling potential null API instance.
The non-null assertion (
api!
) could lead to runtime errors if the API instance is null.Apply this diff to add a null check:
- execCancelSwap(item as ActionCancelSwap, api!, executeTransaction), + execCancelSwap(item as ActionCancelSwap, api ?? throwError('API instance is required'), executeTransaction),Add this helper function at the top of the file:
function throwError(message: string): never { throw new Error(message) }
🧹 Nitpick comments (1)
composables/transaction/types.ts (1)
6-6
: LGTM: Import change improves code organization.The change not only aligns with the dependency removal but also improves code organization by:
- Moving to a local source for
Interaction
- Introducing
ShoppingActions
type for shopping-specific operations- Maintaining clear separation of concerns between general interactions and shopping actions
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (36)
components/collection/HeroButtonDeleteNfts.vue
(1 hunks)components/collection/activity/Activity.vue
(1 hunks)components/collection/activity/ActivityChart.vue
(1 hunks)components/collection/activity/events/Events.vue
(1 hunks)components/collection/activity/events/eventRow/common.ts
(1 hunks)components/common/ItemBurnModal.vue
(1 hunks)components/common/ItemTransferModal.vue
(1 hunks)components/common/autoTeleport/utils.ts
(1 hunks)components/common/listingCart/ListingCartModal.vue
(1 hunks)components/create/CreateCollection.vue
(2 hunks)components/create/CreateNft.vue
(3 hunks)components/gallery/GalleryItemButton/GalleryItemMoreActionBtn.vue
(1 hunks)components/migrate/steps/SignLoader3.vue
(1 hunks)components/profile/ProfileDetail.vue
(1 hunks)components/profile/activityTab/Activity.vue
(1 hunks)components/profile/activityTab/History.vue
(1 hunks)composables/autoTeleport/utils.ts
(1 hunks)composables/collectionActivity/helpers.ts
(1 hunks)composables/collectionActivity/types.ts
(1 hunks)composables/massmint/massMintHelpers.ts
(1 hunks)composables/massmint/useMassMint.ts
(1 hunks)composables/transaction/transactionBurn.ts
(1 hunks)composables/transaction/transactionList.ts
(1 hunks)composables/transaction/transactionSend.ts
(1 hunks)composables/transaction/transactionUpdateCollection.ts
(0 hunks)composables/transaction/types.ts
(1 hunks)composables/transaction/utils.ts
(1 hunks)composables/useTransaction.ts
(1 hunks)nuxt.config.ts
(0 hunks)package.json
(0 hunks)utils/cachingStrategy.ts
(0 hunks)utils/format/balance.ts
(1 hunks)utils/historyEvent.ts
(1 hunks)utils/nft.ts
(1 hunks)utils/shoppingActions.ts
(1 hunks)utils/transactionExecutor.ts
(1 hunks)
💤 Files with no reviewable changes (4)
- composables/transaction/transactionUpdateCollection.ts
- package.json
- nuxt.config.ts
- utils/cachingStrategy.ts
✅ Files skipped from review due to trivial changes (8)
- utils/historyEvent.ts
- components/common/autoTeleport/utils.ts
- utils/transactionExecutor.ts
- composables/transaction/transactionList.ts
- composables/transaction/transactionSend.ts
- composables/massmint/massMintHelpers.ts
- composables/transaction/utils.ts
- composables/collectionActivity/types.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Cloudflare Pages: koda-art-prod
🔇 Additional comments (27)
components/migrate/steps/SignLoader3.vue (1)
86-86
: Import path updated correctly.The import path for the
Interaction
enum has been updated from an external package to a local utility file, which aligns with the PR objective of removing minimark dependencies.utils/format/balance.ts (1)
5-5
: Good addition of the localtrimAll
function.The function properly handles optional input with a fallback to empty string and correctly removes all whitespace characters. This local implementation replaces the previously imported function from the minimark package, making the codebase more self-contained.
components/profile/ProfileDetail.vue (1)
467-467
: Import path correctly updated.The import statement for
Interaction
has been successfully modified to use the local utility file instead of the external minimark package, consistent with the refactoring goal.components/profile/activityTab/Activity.vue (1)
54-54
: Import path updated with alias preserved.The import statement for
Interaction
(aliased asInteractionEnum
) has been properly updated to use the local utility module while maintaining the same alias, ensuring no changes to the component's functionality.components/collection/activity/events/eventRow/common.ts (1)
1-1
: LGTM! Import refactored correctly.The import statement has been successfully updated to use the local module, maintaining consistency with the codebase-wide refactoring effort to remove the minimark dependency.
composables/massmint/useMassMint.ts (1)
5-5
: LGTM! Import refactored correctly.The import statement has been successfully updated to use the local module, maintaining the MINTNFT interaction type functionality.
components/profile/activityTab/History.vue (1)
85-85
: LGTM! Import refactored correctly.The import statement has been successfully updated to use the local module, maintaining all interaction type functionality used throughout the component.
components/common/ItemBurnModal.vue (1)
31-31
: LGTM! Import refactored correctly.The import statement has been successfully updated to use the local module, maintaining the CONSUME interaction type functionality.
composables/collectionActivity/helpers.ts (1)
9-9
: LGTM! Import change aligns with refactoring goal.The change from
@kodadot1/minimark/v1
to@/utils/shoppingActions
is consistent with the PR's objective to remove the minimark dependency. The usage ofInteraction
throughout the file remains valid.components/collection/activity/Activity.vue (1)
58-58
: LGTM! Import change aligns with refactoring goal.The change from
@kodadot1/minimark/v1
to@/utils/shoppingActions
is consistent with the PR's objective to remove the minimark dependency. The usage ofInteraction
in the component remains valid.components/collection/activity/events/Events.vue (1)
52-52
: LGTM! Import change aligns with refactoring goal.The change from
@kodadot1/minimark/v1
to@/utils/shoppingActions
is consistent with the PR's objective to remove the minimark dependency. The usage ofInteraction
in the component remains valid.components/collection/activity/ActivityChart.vue (1)
32-32
: LGTM: Import change aligns with dependency removal.The change to import
Interaction
from local utils is consistent with the refactoring goal of removing the minimark dependency.components/common/ItemTransferModal.vue (1)
49-49
: LGTM: Import change aligns with dependency removal.The change to import
Interaction
from local utils is consistent with the refactoring goal of removing the minimark dependency.components/gallery/GalleryItemButton/GalleryItemMoreActionBtn.vue (1)
61-61
: LGTM: Import change aligns with dependency removal.The change to import
Interaction
from local utils is consistent with the refactoring goal of removing the minimark dependency.components/common/listingCart/ListingCartModal.vue (1)
100-100
: Update import source to local module. Looks good!This change correctly updates the import source of the
Interaction
enum from the external package@kodadot1/minimark/v1
to the local module@/utils/shoppingActions
, aligning with the PR's goal of removing the minimark dependency.components/collection/HeroButtonDeleteNfts.vue (1)
16-16
: Import path updated correctly.The
Interaction
enum import has been properly updated to use the local implementation from@/utils/shoppingActions
instead of the external minimark package.utils/nft.ts (2)
4-15
: Well-defined type interfaces for NFT creation.These type definitions provide a clear structure for NFT-related data, with
AbstractCreatedNFT
containing the essential required properties andCreatedNFT
extending it with additional fields.
24-31
: Good implementation of NFT ID generator with proper error handling.The
toNFTId
function includes appropriate validation for required fields and throws a descriptive error when necessary. The formatting of the NFT ID follows a consistent pattern that includes all essential identifying information.utils/shoppingActions.ts (2)
1-23
: Excellent implementation of the Interaction enum.This local implementation of the
Interaction
enum properly replaces the previously imported enum from the minimark package. The comprehensive set of interaction types covers all necessary actions and maintains compatibility with the rest of the codebase.
38-44
: Good composition of shopping actions types.The
ShoppingActions
type and object correctly incorporate the newly definedInteraction
enum along with the existingOfferActions
andSwapActions
enums, ensuring a seamless integration with the existing codebase.composables/useTransaction.ts (1)
50-50
: LGTM! Import refactored from external package to local module.The change aligns with the PR objective of removing the minimark dependency by moving the
Interaction
type to a local module.composables/transaction/transactionBurn.ts (1)
4-4
: LGTM! Import refactored consistently with other files.The change aligns with the PR objective of removing the minimark dependency.
components/create/CreateNft.vue (3)
302-303
: LGTM! Imports refactored consistently.The changes align with the PR objective of removing the minimark dependency.
30-30
: LGTM! Added fallback for image prop.The empty string fallback prevents potential undefined/null issues.
494-497
: LGTM! Simplified transaction call.Removed unnecessary type assertion, making the code cleaner.
components/create/CreateCollection.vue (2)
208-208
: LGTM! Import refactored consistently.The change aligns with the PR objective of removing the minimark dependency.
191-191
: LGTM! Added fallback for txHash prop.The empty string fallback prevents potential undefined/null issues.
|
Thank you for your contribution to the Koda - Generative Art Marketplace.
👇 __ Let's make a quick check before the contribution.
PR Type
Context
Summary by CodeRabbit
New Features
Interaction
enum for structured handling of various interaction types.AbstractCreatedNFT
andCreatedNFT
, along with a new functiontoNFTId
for NFT data management.Refactor
Chores