Skip to content

Commit 24313e9

Browse files
authored
Merge branch 'main' into yash/deploy-config-updates-2
2 parents 7d67711 + 724e7d9 commit 24313e9

File tree

8 files changed

+87
-9
lines changed

8 files changed

+87
-9
lines changed

apps/dashboard/src/app/nebula-app/(app)/components/ChatPageContent.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { useActiveAccount, useActiveWalletChain } from "thirdweb/react";
1717
import { type NebulaContext, promptNebula } from "../api/chat";
1818
import { createSession, updateSession } from "../api/session";
1919
import type { SessionInfo } from "../api/types";
20+
import { examplePrompts } from "../data/examplePrompts";
2021
import { newChatPageUrlStore, newSessionsStore } from "../stores";
2122
import { ChatBar } from "./ChatBar";
2223
import { type ChatMessage, Chats } from "./Chats";
@@ -181,6 +182,23 @@ export function ChatPageContent(props: {
181182
},
182183
]);
183184

185+
const lowerCaseMessage = message.toLowerCase();
186+
// handle hardcoded replies first
187+
const interceptedReply = examplePrompts.find(
188+
(prompt) => prompt.message.toLowerCase() === lowerCaseMessage,
189+
)?.interceptedReply;
190+
191+
if (interceptedReply) {
192+
// slight delay to match other response times
193+
await new Promise((resolve) => setTimeout(resolve, 1000));
194+
setMessages((prev) => [
195+
...prev.slice(0, -1),
196+
{ type: "assistant", text: interceptedReply, request_id: undefined },
197+
]);
198+
199+
return;
200+
}
201+
184202
setIsChatStreaming(true);
185203
setEnableAutoScroll(true);
186204
const abortController = new AbortController();

apps/dashboard/src/app/nebula-app/(app)/components/EmptyStateChatPageContent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function DashedBgDiv(props: {
105105
<div
106106
className={props.className}
107107
style={{
108-
backgroundImage: `linear-gradient(${props.type === "horizontal" ? "90deg" : "180deg"}, hsl(var(--foreground)/20%) 0 30%, transparent 0 100%)`,
108+
backgroundImage: `linear-gradient(${props.type === "horizontal" ? "90deg" : "180deg"}, hsl(var(--active-border)) 0 30%, transparent 0 100%)`,
109109
backgroundRepeat: "repeat",
110110
backgroundSize: "10px 10px",
111111
maskImage: `linear-gradient(${

apps/dashboard/src/app/nebula-app/(app)/data/examplePrompts.ts

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,68 @@
11
type ExamplePrompt = {
22
title: string;
33
message: string;
4+
interceptedReply?: string;
45
};
56

6-
// Note:
7-
// Keep the title as short as possible so 2 of them can fit in a single row on desktop viewport
8-
// title is only used for displaying the example - the `message` is sent to server when user clicks on the example - it can be as long and descriptive as needed
7+
const whatCanNebulaDoReply = `
8+
Nebula is a natural language model with improved blockchain reasoning, autonomous transaction capabilities, and real-time access to the blockchain.
9+
[Learn more about Nebula](https://portal.thirdweb.com/nebula)
10+
11+
Here are some example actions you can perform with Nebula:
12+
13+
### Bridge & Swap
14+
Bridge and swap native currencies
15+
- Swap 1 USDC to 1 USDT on the Ethereum Mainnet
16+
- Bridge 0.5 ETH from Ethereum Mainnet to Polygon
17+
18+
### Transfer
19+
Send native and ERC-20 currencies
20+
- Send 0.1 ETH to vitalik.eth
21+
- Transfer 1 USDC to saminacodes.eth on Base
22+
23+
### Deploy
24+
Deploy published contracts
25+
- Deploy a Token ERC20 Contract
26+
- Deploy a Split contract with two recipients.
27+
- Deploy an ERC1155 Contract named 'Hello World' with description 'Hello badges on Ethereum'
28+
29+
### Understand
30+
Retrieve information about smart contracts.
31+
- What ERC standards are implemented by contract address 0x59325733eb952a92e069C87F0A6168b29E80627f on Ethereum?
32+
- What functions can I use to mint more of my contract's NFTs?
33+
- What is the total supply of NFTs for my contract?
34+
35+
### Interact
36+
Query wallet balances, addresses, and token holdings.
37+
- How much ETH is in my wallet?
38+
- What is the wallet address of vitalik.eth?
39+
- Does my wallet hold USDC on Base?
40+
41+
### Explore
42+
Access blockchain-specific data.
43+
- What is the last block on zkSync?
44+
- What is the current gas price on Avalanche C-Chain?
45+
- Can you show me transaction details for 0xdfc450bb39e44bd37c22e0bfd0e5212edbea571e4e534d87b5cbbf06f10b9e04 on Optimism?
46+
47+
### Research
48+
Obtain details about tokens, their addresses, and current prices.
49+
- What is the address of USDC on Ethereum?
50+
- Is there a UNI token on Arbitrum?
51+
- What is the current price of ARB?
52+
53+
### Build
54+
Implement features using Web3 SDKs and tools.
55+
- How can I add a connect wallet button to my web app? I want to support users connecting with both email/social wallets and MetaMask and use smart wallets.
56+
- Can you show me how to claim an NFT from an ERC721 using TypeScript?
57+
- I have an ERC1155 contract from thirdweb. Can you show me how to generate and mint with a signature?
58+
`;
959

1060
export const examplePrompts: ExamplePrompt[] = [
61+
{
62+
title: "What can Nebula do?",
63+
message: "What can Nebula do?",
64+
interceptedReply: whatCanNebulaDoReply,
65+
},
1166
{
1267
title: "Deploy an ERC-20 Token",
1368
message:
@@ -25,8 +80,4 @@ export const examplePrompts: ExamplePrompt[] = [
2580
title: "Transfer 0.001 ETH to thirdweb.eth",
2681
message: "Transfer 0.001 ETH to thirdweb.eth",
2782
},
28-
{
29-
title: "Using session keys in Unity",
30-
message: "How to use session key in Unity?",
31-
},
3283
];

apps/dashboard/src/components/contract-components/published-contract/markdown-renderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const MarkdownRenderer: React.FC<{
9898
href={props.href ?? "#"}
9999
target="_blank"
100100
{...cleanedProps(props)}
101-
className="mt-4 text-link-foreground hover:text-foreground"
101+
className="mt-4 underline decoration-muted-foreground/50 decoration-dotted underline-offset-[5px] hover:text-foreground hover:decoration-foreground hover:decoration-solid"
102102
/>
103103
),
104104

apps/playground-web/src/components/engine/airdrop/TransactionResults.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,23 @@ export function ClaimTransactionResults({
160160
<TableCell>
161161
<span className="flex items-center gap-2">
162162
{result.network === "Base Sep" && (
163+
// eslint-disable-next-line @next/next/no-img-element
163164
<img
164165
src="/BaseSep.png"
165166
alt="Base"
166167
className="h-4 w-4"
167168
/>
168169
)}
169170
{result.network === "OP Sep" && (
171+
// eslint-disable-next-line @next/next/no-img-element
170172
<img
171173
src="/OP.png"
172174
alt="Optimism Sep"
173175
className="h-4 w-4"
174176
/>
175177
)}
176178
{result.network === "Ethereum" && (
179+
// eslint-disable-next-line @next/next/no-img-element
177180
<img
178181
src="/Ethereum.png"
179182
alt="Ethereum"

apps/playground-web/src/components/engine/minting/TransactionResults.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,23 @@ export function ClaimTransactionResults({
158158
<TableCell>
159159
<span className="flex items-center gap-2">
160160
{result.network === "Base Sep" && (
161+
// eslint-disable-next-line @next/next/no-img-element
161162
<img
162163
src="/BaseSep.png"
163164
alt="Base"
164165
className="h-4 w-4"
165166
/>
166167
)}
167168
{result.network === "OP Sep" && (
169+
// eslint-disable-next-line @next/next/no-img-element
168170
<img
169171
src="/OP.png"
170172
alt="Optimism Sep"
171173
className="h-4 w-4"
172174
/>
173175
)}
174176
{result.network === "Ethereum" && (
177+
// eslint-disable-next-line @next/next/no-img-element
175178
<img
176179
src="/Ethereum.png"
177180
alt="Ethereum"

apps/playground-web/src/components/engine/minting/erc1155-mint-to.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export function ERC1155MintTo() {
264264
{account && (
265265
<div className="mt-6 w-full max-w-[400px]">
266266
{image ? (
267+
// eslint-disable-next-line @next/next/no-img-element
267268
<img
268269
src={resolveIpfsUrl(image)}
269270
alt="NFT Preview"

apps/portal/src/components/others/Sidebar.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ function SidebarItem(props: { link: SidebarLink; onLinkClick?: () => void }) {
110110
<Link
111111
href={link.href}
112112
onClick={props.onLinkClick}
113+
target={link.href.startsWith("http") ? "_blank" : undefined}
113114
className={clsx(
114115
"overflow-hidden text-ellipsis py-1.5 font-medium text-base transition-colors duration-300 hover:text-foreground",
115116
isActive ? "font-medium text-foreground" : "text-muted-foreground",
@@ -127,6 +128,7 @@ function SidebarItem(props: { link: SidebarLink; onLinkClick?: () => void }) {
127128
return (
128129
<Link
129130
href={link.href}
131+
target={link.href.startsWith("http") ? "_blank" : undefined}
130132
onClick={props.onLinkClick}
131133
className={clsx(
132134
"block overflow-hidden text-ellipsis py-1.5 font-medium text-base transition-colors duration-300 hover:text-foreground",

0 commit comments

Comments
 (0)