-
Notifications
You must be signed in to change notification settings - Fork 0
Snyk upgrade 2451c960a1220c888a18dfa29f7786c7 #568
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
Snyk upgrade 2451c960a1220c888a18dfa29f7786c7 #568
Conversation
Snyk has created this PR to upgrade nextjs-toploader from 1.6.12 to 3.8.16. See this package in npm: nextjs-toploader See this project in Snyk: https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade shiki from 1.27.0 to 3.2.1. See this package in npm: shiki See this project in Snyk: https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade flexsearch from 0.7.43 to 0.8.143. See this package in npm: flexsearch See this project in Snyk: https://app.snyk.io/org/dargon789/project/a19f499f-38be-44a8-b151-119edbfc95d2?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @walletconnect/sign-client from 2.19.1 to 2.19.2. See this package in npm: @walletconnect/sign-client See this project in Snyk: https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @coinbase/wallet-sdk from 4.3.0 to 4.3.2. See this package in npm: @coinbase/wallet-sdk See this project in Snyk: https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 Co-authored-by: snyk-bot <snyk-bot@snyk.io>
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-INFLIGHT-6095116 Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade @typescript-eslint/parser from 7.14.1 to 8.29.1. See this package in npm: @typescript-eslint/parser See this project in Snyk: https://app.snyk.io/org/dargon789/project/55409c6b-2ed0-4583-b8cd-a5bcabfd7aaa?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Snyk has created this PR to upgrade tailwindcss from 3.4.17 to 4.1.3. See this package in npm: tailwindcss See this project in Snyk: https://app.snyk.io/org/dargon789/project/55409c6b-2ed0-4583-b8cd-a5bcabfd7aaa?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io>
Bumps [@radix-ui/react-hover-card](https://github.com/radix-ui/primitives) from 1.1.7 to 1.1.11. - [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md) - [Commits](https://github.com/radix-ui/primitives/commits) --- updated-dependencies: - dependency-name: "@radix-ui/react-hover-card" dependency-version: 1.1.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@chakra-ui/cli](https://github.com/chakra-ui/chakra-ui) from 2.5.6 to 3.16.1. - [Release notes](https://github.com/chakra-ui/chakra-ui/releases) - [Commits](https://github.com/chakra-ui/chakra-ui/compare/@chakra-ui/system@2.5.6...@chakra-ui/cli@3.16.1) --- updated-dependencies: - dependency-name: "@chakra-ui/cli" dependency-version: 3.16.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the npm_and_yarn group with 1 update in the /packages/thirdweb directory: [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite). Updates `vite` from 6.2.6 to 6.2.7 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v6.2.7/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v6.2.7/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 6.2.7 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Create static.yml
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com>
* [NEB-69] Nebula: Add UI for Swap and Approve transactions * Create happy-dodos-reflect.md Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: Manan Tank <manantankm@gmail.com>
Snyk has created this PR to upgrade @aws-sdk/credential-providers from 3.592.0 to 3.806.0. See this package in npm: @aws-sdk/credential-providers See this project in Snyk: https://app.snyk.io/org/dargon789/project/b2aa4281-7627-443a-bbf2-b110a878f4b9?utm_source=github&utm_medium=referral&page=upgrade-pr
Reviewer's GuideRefactors Nebula chat transaction handling to support generic action messages including swaps/approvals, centralizes transaction sending/status UI, and upgrades several dependencies and CI workflows, while adding Storybook coverage and GitHub Pages workflows. Sequence diagram for Nebula transaction and swap execution via useTxSetupsequenceDiagram
actor User
participant Chats
participant RenderMessage
participant ExecuteTransactionCard
participant SwapTransactionCard
participant useTxSetup
participant useSendTransaction
participant Blockchain
User->>Chats: sendMessage("swap 0.1 ETH to USDC")
Chats->>promptNebula: promptNebula(params)
promptNebula-->>Chats: ChatStreamedResponse(event action, type sign_swap, data NebulaSwapData)
Chats->>Chats: setMessages([...,{type action,subtype sign_swap}])
Chats->>RenderMessage: RenderMessage(message sign_swap)
RenderMessage-->>SwapTransactionCard: render swap UI
User->>SwapTransactionCard: click TransactionButton
SwapTransactionCard->>useTxSetup: sendTx(tx,onTxSettled)
useTxSetup->>useSendTransaction: mutateAsync(tx)
useTxSetup->>useTxSetup: setStatus(type sending)
useSendTransaction-->>useTxSetup: submittedReceipt(transactionHash)
useTxSetup->>useTxSetup: setStatus(type confirming,txHash)
useTxSetup->>Blockchain: waitForReceipt(submittedReceipt)
Blockchain-->>useTxSetup: confirmReceipt(transactionHash)
useTxSetup->>useTxSetup: setStatus(type confirmed,txHash)
useTxSetup-->>SwapTransactionCard: onTxSettled(txHash)
note over User,SwapTransactionCard: Same flow is reused by ExecuteTransactionCard
User->>ExecuteTransactionCard: click TransactionButton
ExecuteTransactionCard->>useTxSetup: sendTx(tx,onTxSettled)
useTxSetup->>useSendTransaction: mutateAsync(tx)
useSendTransaction-->>useTxSetup: submittedReceipt
useTxSetup->>Blockchain: waitForReceipt
Blockchain-->>useTxSetup: confirmReceipt
useTxSetup-->>ExecuteTransactionCard: onTxSettled(txHash)
ExecuteTransactionCard-->>Chats: sendMessage(getTransactionSettledPrompt(txHash))
Class diagram for Nebula chat actions, transactions, and swap cardsclassDiagram
class NebulaTxData {
+number chainId
+string data
+string to
+string value
}
class NebulaSwapData {
+string action
+NebulaSwapTransaction transaction
+NebulaSwapToken to
+NebulaSwapToken from
+NebulaSwapIntent intent
}
class NebulaSwapTransaction {
+number chainId
+string to
+string data
}
class NebulaSwapToken {
+string address
+string amount
+number chain_id
+number decimals
+string symbol
}
class NebulaSwapIntent {
+string amount
+number destinationChainId
+string destinationTokenAddress
+number originChainId
+string originTokenAddress
+string receiver
+string sender
}
class ChatMessage {
}
class AssistantMessage {
+"assistant" type
+string text
}
class PresenceMessage {
+"presence" type
+string[] texts
}
class ErrorMessage {
+"error" type
+string text
}
class ActionMessage {
+"action" type
+string subtype
+NebulaTxData data
+NebulaSwapData data
}
class Chats {
+ChatMessage[] messages
+RenderMessage(message,isMessagePending,client,sendMessage)
}
class RenderMessage {
+RenderMessage(message,isMessagePending,client,sendMessage)
}
class ExecuteTransactionCard {
+NebulaTxData txData
+ThirdwebClient client
+onTxSettled(txHash)
}
class ExecuteTransactionCardLayout {
+NebulaTxData txData
+ThirdwebClient client
+TxStatus status
+setStatus(status)
+sendTx(tx,onTxSettled)
+onTxSettled(txHash)
}
class SwapTransactionCard {
+NebulaSwapData swapData
+ThirdwebClient client
+onTxSettled(txHash)
}
class SwapTransactionCardLayout {
+NebulaSwapData swapData
+ThirdwebClient client
+TxStatus status
+setStatus(status)
+sendTx(tx)
}
class ApproveTransactionCard {
+NebulaSwapData swapData
+ThirdwebClient client
}
class ApproveTransactionCardLayout {
+NebulaSwapData swapData
+ThirdwebClient client
+TxStatus status
+setStatus(status)
+sendTx(tx)
}
class TxStatus {
+"idle" type
+"sending" type
+"confirming" type
+"confirmed" type
+"failed" type
+string txHash
}
class TxStatusRow {
+TxStatus status
}
class TxHashRow {
+number chainId
+string txHash
}
class useTxSetup {
+TxStatus status
+setStatus(status)
+sendTx(tx,onTxSettled)
}
class promptNebula {
+promptNebula(params)
}
class ChatStreamedResponse {
+"action" event
+"sign_transaction" type
+"sign_swap" type
+NebulaTxData data
+NebulaSwapData data
}
class ChatPageContent {
+handleNebulaPrompt(params)
}
ChatMessage <|-- AssistantMessage
ChatMessage <|-- PresenceMessage
ChatMessage <|-- ErrorMessage
ChatMessage <|-- ActionMessage
NebulaSwapData *-- NebulaSwapTransaction
NebulaSwapData *-- NebulaSwapToken : from
NebulaSwapData *-- NebulaSwapToken : to
NebulaSwapData *-- NebulaSwapIntent
Chats o-- ChatMessage
Chats ..> RenderMessage
RenderMessage ..> ExecuteTransactionCard
RenderMessage ..> SwapTransactionCard
RenderMessage ..> ApproveTransactionCard
ExecuteTransactionCard o-- ExecuteTransactionCardLayout
ExecuteTransactionCardLayout ..> TxStatus
ExecuteTransactionCardLayout ..> TxStatusRow
ExecuteTransactionCardLayout ..> TxHashRow
ExecuteTransactionCardLayout ..> useTxSetup
SwapTransactionCard o-- SwapTransactionCardLayout
ApproveTransactionCard o-- ApproveTransactionCardLayout
SwapTransactionCardLayout ..> TxStatus
SwapTransactionCardLayout ..> TxStatusRow
SwapTransactionCardLayout ..> TxHashRow
SwapTransactionCardLayout ..> useTxSetup
ApproveTransactionCardLayout ..> TxStatus
ApproveTransactionCardLayout ..> TxStatusRow
ApproveTransactionCardLayout ..> TxHashRow
ApproveTransactionCardLayout ..> useTxSetup
TxStatusRow ..> TxStatus
TxHashRow ..> NebulaTxData
useTxSetup ..> TxStatus
promptNebula ..> ChatStreamedResponse
ChatStreamedResponse ..> NebulaTxData
ChatStreamedResponse ..> NebulaSwapData
ChatPageContent ..> ChatMessage
ChatPageContent ..> promptNebula
ChatPageContent ..> ChatStreamedResponse
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @Dargon789, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Nebula chat application by integrating robust support for cryptocurrency swap and approval transactions, complete with dedicated UI components. It also includes a substantial refactoring of transaction management to promote code reusability and maintainability. Concurrently, several key dependencies across the project have been updated to their latest versions, ensuring the application remains current and secure. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Hey - I've found 1 security issue, 4 other issues, and left some high level feedback:
Security issues:
- Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)
General comments:
- In
NebulaSwapDatatheactionfield is typed as a genericstringbut your UI only handles specific values like"approval"and swap actions, so tightening this to a string union (e.g.'sell' | 'approval') would make the message handling safer and easier to reason about. - The
useTxSetuphook inSwap/common.tsxalways tracks analytics under theexecute_transactionaction, even for swaps and approvals; consider allowing the caller to pass a context or label so that analytics can distinguish between execute, swap, and approve flows. - The new GitHub Pages workflows (
nextjs.yml,jekyll-gh-pages.yml,static.yml) assume a single-package setup withnpm/yarnat the repo root and a single Next.js app, which may not match this monorepo/pnpm layout—if these are meant to be used, wiring them to the actual app directories and package manager will likely be necessary.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `NebulaSwapData` the `action` field is typed as a generic `string` but your UI only handles specific values like `"approval"` and swap actions, so tightening this to a string union (e.g. `'sell' | 'approval'`) would make the message handling safer and easier to reason about.
- The `useTxSetup` hook in `Swap/common.tsx` always tracks analytics under the `execute_transaction` action, even for swaps and approvals; consider allowing the caller to pass a context or label so that analytics can distinguish between execute, swap, and approve flows.
- The new GitHub Pages workflows (`nextjs.yml`, `jekyll-gh-pages.yml`, `static.yml`) assume a single-package setup with `npm/yarn` at the repo root and a single Next.js app, which may not match this monorepo/pnpm layout—if these are meant to be used, wiring them to the actual app directories and package manager will likely be necessary.
## Individual Comments
### Comment 1
<location> `apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.tsx:145` </location>
<code_context>
data: txData.data,
to: txData.to,
- value: BigInt(txData.value),
+ value: txData.value ? BigInt(txData.value) : undefined,
});
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Guard the `value` conversion explicitly against `undefined` rather than generic truthiness.
`txData.value ? BigInt(txData.value) : undefined` relies on truthiness and will treat any falsy-but-valid value as `undefined`. Given the type is `string | undefined`, it’s safer and clearer to check explicitly:
```ts
value: txData.value !== undefined ? BigInt(txData.value) : undefined,
```
</issue_to_address>
### Comment 2
<location> `apps/dashboard/src/app/nebula-app/(app)/components/Swap/common.tsx:130-139` </location>
<code_context>
- },
- });
const chain = useV5DashboardChain(txData.chainId);
- const trackEvent = useTrack();
const account = useActiveAccount();
</code_context>
<issue_to_address>
**suggestion:** Differentiate analytics events for swaps vs. generic transactions or make the action configurable.
`useTxSetup` always sends `action: "execute_transaction"` with no chain-specific metadata, but it’s now used for both simple sends and swap/approval flows. That makes these flows indistinguishable in analytics and drops the previously tracked `chainId` context.
Recommend either:
- Accepting an `analyticsContext` (e.g. `action`, optional `chainId`, and maybe `flow: "swap" | "approval" | "send"`), or
- At least parameterizing the `action` string so swap-related flows aren’t lumped into a generic "execute_transaction" event.
Suggested implementation:
```typescript
export type TxAnalyticsContext = {
/**
* Analytics "action" name, e.g. "execute_transaction", "swap", "approval".
* If omitted, callers should fall back to the existing "execute_transaction" default.
*/
action?: string;
/**
* Optional chain identifier for analytics. Allows restoring the previously
* tracked chainId context independently of txData/chain hooks.
*/
chainId?: number | string;
/**
* High-level flow name for analytics segmentation.
* e.g. "swap" | "approval" | "send"
*/
flow?: "swap" | "approval" | "send" | (string & {});
};
export function useTxSetup(analyticsContext?: TxAnalyticsContext) {
const [status, setStatus] = useState<TxStatus>({ type: "idle" });
const { theme } = useTheme();
const sendTransaction = useSendTransaction({
payModal: {
theme: getSDKTheme(theme === "light" ? "light" : "dark"),
},
});
export type TxStatus =
| {
type: "idle";
}
| {
type: "sending";
}
| {
type: "confirming";
txHash: string;
```
To fully implement the analytics behavior you described, you should also:
1. Re-introduce `const trackEvent = useTrack();` in this hook if it was removed, or ensure whatever tracking hook is used is available inside `useTxSetup`.
2. Find the code inside `useTxSetup` where the analytics event is fired (currently hardcoding `action: "execute_transaction"` and omitting chain-specific metadata) and update it to something like:
- `const action = analyticsContext?.action ?? "execute_transaction";`
- `const flow = analyticsContext?.flow;`
- `const analyticsChainId = analyticsContext?.chainId ?? txData.chainId ?? chain?.id;`
- Then call `trackEvent` with these values, e.g. `trackEvent("execute_transaction", { action, flow, chainId: analyticsChainId, ...otherProps });`
3. Update all call sites of `useTxSetup`:
- For swap flows: `useTxSetup({ action: "swap_execute_transaction", flow: "swap", chainId: txData.chainId });`
- For approvals: `useTxSetup({ action: "approval_execute_transaction", flow: "approval", chainId: txData.chainId });`
- For simple sends: either omit the argument or explicitly pass `{ action: "execute_transaction", flow: "send", chainId }` for clarity.
These changes will ensure swap/approval/send flows are distinguishable in analytics and restore chainId context while maintaining backward-compatible defaults.
</issue_to_address>
### Comment 3
<location> `.changeset/fluffy-rats-jog.md:9` </location>
<code_context>
+"wallet-ui": patch
+---
+
+compare feat: upgrade fix and bug merge.
</code_context>
<issue_to_address>
**suggestion (typo):** The description sentence is grammatically unclear; consider rephrasing for readability.
The phrase "compare feat: upgrade fix and bug merge" is hard to understand and may confuse readers. Please rephrase it to clearly describe what is being compared or what this patch does (for example, "Compare feature upgrade fixes and bug merges" or a more specific summary).
</issue_to_address>
### Comment 4
<location> `.changeset/seven-goats-move.md:5` </location>
<code_context>
+"wallet-ui": patch
+---
+
+compare feat: upgrade fix and bug merge.
</code_context>
<issue_to_address>
**suggestion (typo):** The description sentence is grammatically unclear; consider rephrasing for readability.
The phrase "compare feat: upgrade fix and bug merge" is ambiguous. Please reword it to clearly state what this patch does (e.g., whether it upgrades fixes, merges bug fixes, or something else).
</issue_to_address>
### Comment 5
<location> `apps/dashboard/src/app/nebula-app/(app)/components/Swap/SwapCards.stories.tsx:35` </location>
<code_context>
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
</code_context>
<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.
*Source: gitleaks*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
apps/dashboard/src/app/nebula-app/(app)/components/ExecuteTransactionCard.tsx
Show resolved
Hide resolved
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.
Code Review
This pull request introduces support for swap and approve transactions in the Nebula chat feature, involving significant refactoring to share transaction handling logic across different action types. It also includes several dependency upgrades. My review focuses on the new transaction flows, data parsing safety, and UI consistency. The refactoring to centralize transaction logic is well-done, but there are opportunities to improve data validation, enhance user-facing error handling, and ensure consistent behavior across different transaction types.
Summary by Sourcery
Add Nebula chat support for swap and approval actions with shared transaction handling, alongside dependency upgrades and new GitHub Pages workflows.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Deployment:
Tests:
Chores: