Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/bright-doors-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@macalinao/token-utils": patch
"@macalinao/gill-extra": patch
"example-dapp": patch
"@macalinao/quarry": patch
"@macalinao/grill": patch
---

Update dependencies
9 changes: 9 additions & 0 deletions .changeset/dirty-clocks-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@macalinao/token-utils": patch
"@macalinao/gill-extra": patch
"example-dapp": patch
"@macalinao/quarry": patch
"@macalinao/grill": patch
---

Remove unnecessary arguments
8 changes: 8 additions & 0 deletions .changeset/fruity-groups-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@macalinao/token-utils": patch
"@macalinao/gill-extra": patch
"example-dapp": patch
"@macalinao/grill": patch
---

Fix broken token metadata fetching -- allow for empty symbols
5 changes: 5 additions & 0 deletions .changeset/smart-keys-play.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@macalinao/gill-extra": patch
---

re-export some addresses of programs
9 changes: 9 additions & 0 deletions .changeset/swift-zebras-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@macalinao/token-utils": patch
"@macalinao/gill-extra": patch
"example-dapp": patch
"@macalinao/quarry": patch
"@macalinao/grill": patch
---

Update dependencies
3 changes: 2 additions & 1 deletion apps/example-dapp/biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"root": false,
"$schema": "https://biomejs.dev/schemas/2.2.7/schema.json",
"extends": "//",
"linter": {
"domains": {
Expand Down
28 changes: 14 additions & 14 deletions apps/example-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,24 @@
"@radix-ui/react-separator": "^1.1.7",
"@radix-ui/react-slot": "^1.2.3",
"@radix-ui/react-tooltip": "^1.2.8",
"@solana-program/system": "^0.8.1",
"@solana-program/token": "^0.6.0",
"@solana-program/token-2022": "^0.5.0",
"@solana-program/system": "^0.9.0",
"@solana-program/token": "^0.7.0",
"@solana-program/token-2022": "^0.6.0",
"@solana/kit": "catalog:",
"@solana/spl-token": "^0.4.14",
"@solana/wallet-adapter-react": "catalog:",
"@solana/wallet-adapter-react-ui": "^0.9.39",
"@solana/wallet-adapter-wallets": "^0.19.37",
"@tailwindcss/vite": "^4.1.14",
"@tailwindcss/vite": "^4.1.16",
"@tanstack/react-query": "catalog:",
"@tanstack/react-router": "^1.132.47",
"@tanstack/react-router": "^1.133.22",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"gill": "catalog:",
"lucide-react": "^0.542.0",
"lucide-react": "^0.546.0",
"react": "catalog:",
"react-dom": "catalog:",
"react-hook-form": "^7.64.0",
"react-hook-form": "^7.65.0",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1",
"zod": "^4.1.12"
Expand All @@ -60,25 +60,25 @@
"@macalinao/grill": "workspace:^"
},
"devDependencies": {
"@eslint/js": "^9.37.0",
"@eslint/js": "^9.38.0",
"@macalinao/eslint-config": "catalog:",
"@macalinao/grill": "workspace:^",
"@macalinao/tsconfig": "catalog:",
"@tanstack/react-query-devtools": "^5.90.2",
"@tanstack/react-router-devtools": "^1.132.50",
"@tanstack/router-plugin": "^1.132.47",
"@tanstack/react-router-devtools": "^1.133.22",
"@tanstack/router-plugin": "^1.133.22",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@vitejs/plugin-react": "^5.0.4",
"eslint": "catalog:",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.23",
"eslint-plugin-react-refresh": "^0.4.24",
"globals": "^16.4.0",
"tailwindcss": "^4.1.14",
"tailwindcss": "^4.1.16",
"tw-animate-css": "^1.4.0",
"typescript": "catalog:",
"typescript-eslint": "^8.46.0",
"vite": "^7.1.9",
"typescript-eslint": "^8.46.2",
"vite": "^7.1.12",
"vite-plugin-node-polyfills": "^0.24.0",
"vite-tsconfig-paths": "^5.1.4"
},
Expand Down
2 changes: 2 additions & 0 deletions apps/example-dapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ declare module "@tanstack/react-router" {

import "@solana/wallet-adapter-react-ui/styles.css";

console.log(import.meta.env);

const endpoint =
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
import.meta.env.VITE_SOLANA_RPC_URL || getPublicSolanaRpcUrl("mainnet-beta");
Expand Down
21 changes: 21 additions & 0 deletions apps/example-dapp/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Route as rootRouteImport } from "./routes/__root.tsx"
import { Route as ExamplesRouteImport } from "./routes/examples.tsx"
import { Route as IndexRouteImport } from "./routes/index.tsx"
import { Route as ExamplesIndexRouteImport } from "./routes/examples/index.tsx"
import { Route as TokenInfoTokenMintRouteImport } from "./routes/token-info.$tokenMint.tsx"
import { Route as ExamplesWrappedSolRouteImport } from "./routes/examples/wrapped-sol.tsx"
import { Route as ExamplesTransferSolRouteImport } from "./routes/examples/transfer-sol.tsx"
import { Route as ExamplesTokensRouteImport } from "./routes/examples/tokens.tsx"
Expand All @@ -35,6 +36,11 @@ const ExamplesIndexRoute = ExamplesIndexRouteImport.update({
path: "/",
getParentRoute: () => ExamplesRoute,
} as any)
const TokenInfoTokenMintRoute = TokenInfoTokenMintRouteImport.update({
id: "/token-info/$tokenMint",
path: "/token-info/$tokenMint",
getParentRoute: () => rootRouteImport,
} as any)
const ExamplesWrappedSolRoute = ExamplesWrappedSolRouteImport.update({
id: "/wrapped-sol",
path: "/wrapped-sol",
Expand Down Expand Up @@ -81,6 +87,7 @@ export interface FileRoutesByFullPath {
"/examples/tokens": typeof ExamplesTokensRoute
"/examples/transfer-sol": typeof ExamplesTransferSolRoute
"/examples/wrapped-sol": typeof ExamplesWrappedSolRoute
"/token-info/$tokenMint": typeof TokenInfoTokenMintRoute
"/examples/": typeof ExamplesIndexRoute
}
export interface FileRoutesByTo {
Expand All @@ -92,6 +99,7 @@ export interface FileRoutesByTo {
"/examples/tokens": typeof ExamplesTokensRoute
"/examples/transfer-sol": typeof ExamplesTransferSolRoute
"/examples/wrapped-sol": typeof ExamplesWrappedSolRoute
"/token-info/$tokenMint": typeof TokenInfoTokenMintRoute
"/examples": typeof ExamplesIndexRoute
}
export interface FileRoutesById {
Expand All @@ -105,6 +113,7 @@ export interface FileRoutesById {
"/examples/tokens": typeof ExamplesTokensRoute
"/examples/transfer-sol": typeof ExamplesTransferSolRoute
"/examples/wrapped-sol": typeof ExamplesWrappedSolRoute
"/token-info/$tokenMint": typeof TokenInfoTokenMintRoute
"/examples/": typeof ExamplesIndexRoute
}
export interface FileRouteTypes {
Expand All @@ -119,6 +128,7 @@ export interface FileRouteTypes {
| "/examples/tokens"
| "/examples/transfer-sol"
| "/examples/wrapped-sol"
| "/token-info/$tokenMint"
| "/examples/"
fileRoutesByTo: FileRoutesByTo
to:
Expand All @@ -130,6 +140,7 @@ export interface FileRouteTypes {
| "/examples/tokens"
| "/examples/transfer-sol"
| "/examples/wrapped-sol"
| "/token-info/$tokenMint"
| "/examples"
id:
| "__root__"
Expand All @@ -142,12 +153,14 @@ export interface FileRouteTypes {
| "/examples/tokens"
| "/examples/transfer-sol"
| "/examples/wrapped-sol"
| "/token-info/$tokenMint"
| "/examples/"
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
ExamplesRoute: typeof ExamplesRouteWithChildren
TokenInfoTokenMintRoute: typeof TokenInfoTokenMintRoute
}

declare module "@tanstack/react-router" {
Expand All @@ -173,6 +186,13 @@ declare module "@tanstack/react-router" {
preLoaderRoute: typeof ExamplesIndexRouteImport
parentRoute: typeof ExamplesRoute
}
"/token-info/$tokenMint": {
id: "/token-info/$tokenMint"
path: "/token-info/$tokenMint"
fullPath: "/token-info/$tokenMint"
preLoaderRoute: typeof TokenInfoTokenMintRouteImport
parentRoute: typeof rootRouteImport
}
"/examples/wrapped-sol": {
id: "/examples/wrapped-sol"
path: "/wrapped-sol"
Expand Down Expand Up @@ -254,6 +274,7 @@ const ExamplesRouteWithChildren = ExamplesRoute._addFileChildren(
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
ExamplesRoute: ExamplesRouteWithChildren,
TokenInfoTokenMintRoute: TokenInfoTokenMintRoute,
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
Expand Down
106 changes: 106 additions & 0 deletions apps/example-dapp/src/routes/token-info.$tokenMint.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { useTokenInfo } from "@macalinao/grill";
import { address } from "@solana/kit";
import { createFileRoute } from "@tanstack/react-router";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";

function TokenInfoPage() {
const { tokenMint } = Route.useParams();

const {
data: tokenInfo,
isLoading,
error,
} = useTokenInfo({
mint: tokenMint ? address(tokenMint) : null,
});

if (isLoading) {
return (
<div className="container mx-auto p-6">
<h1 className="text-2xl font-bold mb-6">Token Information</h1>
<div>Loading token information...</div>
</div>
);
}

if (error) {
return (
<div className="container mx-auto p-6">
<h1 className="text-2xl font-bold mb-6">Token Information</h1>
<div className="text-red-500">Error loading token: {error.message}</div>
</div>
);
}

if (!tokenInfo) {
return (
<div className="container mx-auto p-6">
<h1 className="text-2xl font-bold mb-6">Token Information</h1>
<div>No token information found for mint: {tokenMint}</div>
</div>
);
}

return (
<div className="container mx-auto p-6">
<h1 className="text-2xl font-bold mb-6">Token Information</h1>

<Card>
<CardHeader>
<CardTitle className="flex items-center gap-3">
{tokenInfo.iconURL && (
<img
src={tokenInfo.iconURL}
alt={`${tokenInfo.symbol} icon`}
className="w-8 h-8 rounded-full"
/>
)}
{tokenInfo.name} ({tokenInfo.symbol})
</CardTitle>
</CardHeader>
<CardContent className="space-y-4">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<h3 className="font-semibold text-sm text-gray-600">Name</h3>
<p className="text-lg">{tokenInfo.name}</p>
</div>

<div>
<h3 className="font-semibold text-sm text-gray-600">Symbol</h3>
<p className="text-lg">{tokenInfo.symbol}</p>
</div>

<div>
<h3 className="font-semibold text-sm text-gray-600">Decimals</h3>
<p className="text-lg">{tokenInfo.decimals}</p>
</div>

<div>
<h3 className="font-semibold text-sm text-gray-600">
Mint Address
</h3>
<p className="text-sm font-mono rounded break-all">
{tokenInfo.mint}
</p>
</div>

{tokenInfo.iconURL && (
<div className="md:col-span-2">
<h3 className="font-semibold text-sm text-gray-600">
Icon URL
</h3>
<p className="text-sm font-mono rounded break-all">
{tokenInfo.iconURL}
</p>
</div>
)}
</div>
</CardContent>
</Card>
</div>
);
}

export const Route = createFileRoute("/token-info/$tokenMint")({
component: TokenInfoPage,
});
2 changes: 1 addition & 1 deletion biome.jsonc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.7/schema.json",
"extends": ["@macalinao/biome-config/base"]
}
Loading