Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fa231b0
Add missing DomaAPI.getDashboardStats to fix dashboard error
builderio-bot Sep 1, 2025
8bc1c84
Add simulation-only toggle and short-circuit GraphQL fetches
builderio-bot Sep 1, 2025
c6c70dc
Enable wallet-based tokenization with signing; add missing API method…
builderio-bot Sep 1, 2025
0c5d9fe
Propagate wallet address to dashboard via ConnectWallet; pass address…
builderio-bot Sep 1, 2025
2dfc844
Switch wallet network to Doma Testnet (Sepolia) with addChain fallback
builderio-bot Sep 2, 2025
9509a51
Fix Web3 tuple argument encoding and payable call for requestTokeniza…
builderio-bot Sep 2, 2025
c1149a9
Fallback to API/simulation when wallet tokenization returns false
builderio-bot Sep 2, 2025
cb4f22b
Validate domain input to prevent Web3ValidatorError
builderio-bot Sep 2, 2025
6007ffa
Guard against invalid domain tuples before sending to contracts
builderio-bot Sep 2, 2025
efd804c
Update to single Doma Network configuration across contracts and wallet
builderio-bot Sep 2, 2025
e572615
Use Doma RPC as default fallback
builderio-bot Sep 2, 2025
8e47898
Set Doma Network chainId and endpoints only; update messages and samp…
builderio-bot Sep 2, 2025
1453f30
Update dashboard badges to Doma Network and remove multi-chain suppor…
builderio-bot Sep 2, 2025
c65a606
Restrict supported chains to only Doma Network
builderio-bot Sep 2, 2025
f85cbe1
Set defaults and messaging for single-chain Doma bridge
builderio-bot Sep 2, 2025
3ede5c4
Update marketplace chain label to Doma Network
builderio-bot Sep 2, 2025
2a39153
Update Domain Monitor to Doma Network and explorer links
builderio-bot Sep 2, 2025
eb12b61
Update wallet assets dashboard network messaging and explorer link
builderio-bot Sep 2, 2025
b8fce27
Tokenization panel: update network label and explorer link
builderio-bot Sep 2, 2025
4c57e13
Improve error messages and add pre-checks for network and contracts
builderio-bot Sep 2, 2025
1b9480a
Auto add/switch network in smart contracts service
builderio-bot Sep 2, 2025
3e3e27b
Auto-switch attempt on wrong network before throwing
builderio-bot Sep 2, 2025
1547985
Add auto addEthereumChain fallback in wallet-utils switchNetwork
builderio-bot Sep 2, 2025
2db9c20
Normalize contract addresses to lowercase to satisfy Web3 address val…
builderio-bot Sep 2, 2025
3fafac7
Lowercase placeholder contract address in API config
builderio-bot Sep 2, 2025
e2a2e5f
Normalize legacy placeholder addresses to lowercase
builderio-bot Sep 2, 2025
c04ab63
Replace throws with early returns to prevent console errors and allow…
builderio-bot Sep 2, 2025
cb965c7
Make tokenizeDomain respect simulation flag and avoid fake success; g…
builderio-bot Sep 2, 2025
f3ab15b
Set provided OWNERSHIP_TOKEN address
builderio-bot Sep 2, 2025
e3cc59a
Add EIP-1967 slot constant to class
builderio-bot Sep 2, 2025
7170dca
Insert proxy detection helper before factory function
builderio-bot Sep 2, 2025
b63b292
Add getDomaAnalytics API to fix missing function error
builderio-bot Sep 2, 2025
c4b7560
Add DOMA_USE_SIMULATION flag to smart contracts service
builderio-bot Sep 2, 2025
63422ac
Enable simulation and use robust deployment check in requestTokenization
builderio-bot Sep 2, 2025
ada42a2
Enable simulation and use robust deployment check in claimOwnership
builderio-bot Sep 2, 2025
6cf54d0
Enable simulation and use robust deployment check in bridge
builderio-bot Sep 2, 2025
c244fa6
Enable simulation and use robust deployment check in requestDetokeniz…
builderio-bot Sep 2, 2025
a7c34df
Fix missing Pie import from recharts
builderio-bot Sep 2, 2025
675f0b3
Use env var for DOMA_API_KEY to avoid hardcoding secrets
builderio-bot Sep 2, 2025
e351143
Add dynamic contract address resolution and lazy init
builderio-bot Sep 2, 2025
e01907c
Call init() before contract interactions
builderio-bot Sep 2, 2025
db065ab
Ensure init() called in all public methods
builderio-bot Sep 2, 2025
867ee1f
Bypass on-chain calls in web3-utils when simulation is enabled
builderio-bot Sep 2, 2025
844a6a2
Add simulation short-circuit in DomaWeb3Service methods
builderio-bot Sep 2, 2025
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
53 changes: 44 additions & 9 deletions components/connect-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import { Badge } from "@/components/ui/badge"
import { Wallet, ChevronDown, AlertCircle, Shield } from "lucide-react"
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
import { Alert, AlertDescription } from "@/components/ui/alert"
import { DOMA_CHAIN_CONFIG } from "@/lib/doma-smart-contracts"

interface ConnectWalletProps {
isConnected: boolean
onConnect: (connected: boolean) => void
onConnect: (connected: boolean, address?: string) => void
}

declare global {
Expand Down Expand Up @@ -38,7 +39,7 @@ export function ConnectWallet({ isConnected, onConnect }: ConnectWalletProps) {
const account = accounts[0]
setAddress(formatAddress(account))
setConnectedWallet("MetaMask")
onConnect(true)
onConnect(true, account)
return
}
} catch (error) {
Expand All @@ -53,7 +54,7 @@ export function ConnectWallet({ isConnected, onConnect }: ConnectWalletProps) {
const account = accounts[0]
setAddress(formatAddress(account))
setConnectedWallet("OKX Wallet")
onConnect(true)
onConnect(true, account)
return
}
} catch (error) {
Expand Down Expand Up @@ -99,15 +100,32 @@ export function ConnectWallet({ isConnected, onConnect }: ConnectWalletProps) {
const account = accounts[0]
setAddress(formatAddress(account))
setConnectedWallet("MetaMask")
onConnect(true)
onConnect(true, account)

try {
await window.ethereum.request({
method: "wallet_switchEthereumChain",
params: [{ chainId: "0x1" }],
params: [{ chainId: DOMA_CHAIN_CONFIG.chainId }],
})
} catch (switchError: any) {
console.log("Network switch error:", switchError)
if (switchError?.code === 4902) {
try {
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [{
chainId: DOMA_CHAIN_CONFIG.chainId,
chainName: DOMA_CHAIN_CONFIG.chainName,
nativeCurrency: DOMA_CHAIN_CONFIG.nativeCurrency,
rpcUrls: DOMA_CHAIN_CONFIG.rpcUrls,
blockExplorerUrls: DOMA_CHAIN_CONFIG.blockExplorerUrls,
}],
})
} catch (addErr) {
console.log("Add chain failed:", addErr)
}
} else {
console.log("Network switch error:", switchError)
}
}
}
} catch (error: any) {
Expand Down Expand Up @@ -141,15 +159,32 @@ export function ConnectWallet({ isConnected, onConnect }: ConnectWalletProps) {
const account = accounts[0]
setAddress(formatAddress(account))
setConnectedWallet("OKX Wallet")
onConnect(true)
onConnect(true, account)

try {
await window.okxwallet.request({
method: "wallet_switchEthereumChain",
params: [{ chainId: "0x1" }],
params: [{ chainId: DOMA_CHAIN_CONFIG.chainId }],
})
} catch (switchError: any) {
console.log("Network switch error:", switchError)
if (switchError?.code === 4902) {
try {
await window.okxwallet.request({
method: "wallet_addEthereumChain",
params: [{
chainId: DOMA_CHAIN_CONFIG.chainId,
chainName: DOMA_CHAIN_CONFIG.chainName,
nativeCurrency: DOMA_CHAIN_CONFIG.nativeCurrency,
rpcUrls: DOMA_CHAIN_CONFIG.rpcUrls,
blockExplorerUrls: DOMA_CHAIN_CONFIG.blockExplorerUrls,
}],
})
} catch (addErr) {
console.log("Add chain failed:", addErr)
}
} else {
console.log("Network switch error:", switchError)
}
}
}
} catch (error: any) {
Expand Down
4 changes: 2 additions & 2 deletions components/doma-analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
Clock,
Shield
} from "lucide-react"
import { LineChart, Line, AreaChart, Area, BarChart, Bar, PieChart as RechartsPieChart, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'
import { LineChart, Line, AreaChart, Area, BarChart, Bar, Pie, PieChart as RechartsPieChart, Cell, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'

interface AnalyticsData {
volume: number
Expand Down Expand Up @@ -582,7 +582,7 @@ export function DomaAnalytics({ walletAddress, isConnected }: DomaAnalyticsProps
{domain.name}
</div>
<div className="text-sm text-muted-foreground">
{domain.registrar} Token #{domain.tokenId}
{domain.registrar} �� Token #{domain.tokenId}
</div>
</div>
</div>
Expand Down
95 changes: 18 additions & 77 deletions components/doma-bridge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,90 +67,25 @@ interface DomaBridgeProps {

const SUPPORTED_CHAINS: SupportedChain[] = [
{
id: 'ethereum',
name: 'Ethereum',
shortName: 'ETH',
chainId: 1,
icon: '',
id: 'doma',
name: 'Doma Network',
shortName: 'DOMA',
chainId: 97476,
icon: '🛡️',
nativeCurrency: 'ETH',
rpcUrl: 'https://mainnet.infura.io/v3/',
explorerUrl: 'https://etherscan.io',
bridgeFee: 0.005,
estimatedTime: '5-10 min',
isTestnet: false
},
{
id: 'sepolia',
name: 'Sepolia Testnet',
shortName: 'SEP',
chainId: 11155111,
icon: '⟠',
nativeCurrency: 'ETH',
rpcUrl: 'https://sepolia.infura.io/v3/',
explorerUrl: 'https://sepolia.etherscan.io',
bridgeFee: 0.001,
estimatedTime: '2-5 min',
rpcUrl: 'https://rpc-testnet.doma.xyz',
explorerUrl: 'https://explorer-testnet.doma.xyz',
bridgeFee: 0,
estimatedTime: '—',
isTestnet: true
},
{
id: 'polygon',
name: 'Polygon',
shortName: 'MATIC',
chainId: 137,
icon: '🔷',
nativeCurrency: 'MATIC',
rpcUrl: 'https://polygon-rpc.com',
explorerUrl: 'https://polygonscan.com',
bridgeFee: 0.1,
estimatedTime: '3-7 min',
isTestnet: false
},
{
id: 'arbitrum',
name: 'Arbitrum One',
shortName: 'ARB',
chainId: 42161,
icon: '🔵',
nativeCurrency: 'ETH',
rpcUrl: 'https://arb1.arbitrum.io/rpc',
explorerUrl: 'https://arbiscan.io',
bridgeFee: 0.002,
estimatedTime: '2-4 min',
isTestnet: false
},
{
id: 'optimism',
name: 'Optimism',
shortName: 'OP',
chainId: 10,
icon: '🔴',
nativeCurrency: 'ETH',
rpcUrl: 'https://mainnet.optimism.io',
explorerUrl: 'https://optimistic.etherscan.io',
bridgeFee: 0.003,
estimatedTime: '3-6 min',
isTestnet: false
},
{
id: 'solana',
name: 'Solana',
shortName: 'SOL',
chainId: 0, // Solana doesn't use EVM chain IDs
icon: '☀️',
nativeCurrency: 'SOL',
rpcUrl: 'https://api.mainnet-beta.solana.com',
explorerUrl: 'https://explorer.solana.com',
bridgeFee: 0.01,
estimatedTime: '1-3 min',
isTestnet: false
}
]

export function DomaBridge({ walletAddress, isConnected }: DomaBridgeProps) {
const [userDomains, setUserDomains] = useState<DomainToken[]>([])
const [selectedDomain, setSelectedDomain] = useState<string>("")
const [fromChain, setFromChain] = useState<string>("sepolia")
const [toChain, setToChain] = useState<string>("polygon")
const [fromChain, setFromChain] = useState<string>("doma")
const [toChain, setToChain] = useState<string>("")
const [toAddress, setToAddress] = useState<string>("")
const [bridgeTransactions, setBridgeTransactions] = useState<BridgeTransaction[]>([])
const [currentBridge, setCurrentBridge] = useState<BridgeTransaction | null>(null)
Expand Down Expand Up @@ -499,7 +434,7 @@ export function DomaBridge({ walletAddress, isConnected }: DomaBridgeProps) {
<CardHeader>
<CardTitle>Bridge Summary</CardTitle>
<CardDescription>
Review your bridge transaction details
Doma Network only. Use the official bridge below for cross-chain actions.
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
Expand Down Expand Up @@ -543,6 +478,12 @@ export function DomaBridge({ walletAddress, isConnected }: DomaBridgeProps) {
</div>

<div className="pt-4 border-t">
<Button variant="outline" asChild className="w-full mb-3">
<a href="https://bridge-testnet.doma.xyz" target="_blank" rel="noopener noreferrer">
<ExternalLink className="h-4 w-4 mr-2" />
Open Doma Bridge
</a>
</Button>
<div className="flex items-center gap-2 p-3 bg-amber-50 dark:bg-amber-950/20 rounded-lg mb-4">
<Shield className="h-4 w-4 text-amber-600" />
<div className="text-sm">
Expand Down
2 changes: 1 addition & 1 deletion components/doma-marketplace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ export function DomaMarketplace({ walletAddress, isConnected }: DomaMarketplaceP
</div>
<div className="flex items-center justify-between text-sm">
<span className="text-muted-foreground">Chain:</span>
<span>Sepolia Testnet</span>
<span>Doma Network</span>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions components/domain-monitor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function DomainMonitor({ walletAddress, isConnected }: DomainMonitorProps
<Button variant="outline" asChild>
<a href="https://start.doma.xyz" target="_blank" rel="noopener noreferrer">
<ExternalLink className="h-4 w-4 mr-2" />
Doma Testnet
Doma Network
</a>
</Button>
</div>
Expand Down Expand Up @@ -262,7 +262,7 @@ export function DomainMonitor({ walletAddress, isConnected }: DomainMonitorProps
<TableCell>
<Button variant="ghost" size="sm" asChild>
<a
href={`https://sepolia.etherscan.io/token/${domain.tokenId}`}
href={`https://explorer-testnet.doma.xyz`}
target="_blank"
rel="noopener noreferrer"
>
Expand Down
13 changes: 3 additions & 10 deletions components/domainfi-dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function DomanitorDashboard() {
Audited
</Badge>
<Badge variant="secondary" className="bg-accent text-accent-foreground">
Doma Testnet
Doma Network
</Badge>
<Badge
variant="secondary"
Expand All @@ -128,13 +128,6 @@ export function DomanitorDashboard() {
</div>
</div>

{/* Support Badge */}
<div className="hidden xl:flex items-center">
<Badge variant="outline" className="bg-gradient-to-r from-blue-500 to-purple-500 text-white border-0">
<Sparkles className="h-3 w-3 mr-1" />
Supporting: Ethereum (.eth) | Solana (.sol) | BNB Chain (.bnb) | Cosmos (.cosmos)
</Badge>
</div>

{/* Right Side Actions */}
<div className="flex items-center space-x-2">
Expand Down Expand Up @@ -202,7 +195,7 @@ export function DomanitorDashboard() {
Audited
</Badge>
<Badge variant="secondary" className="bg-accent text-accent-foreground">
Doma Testnet
Doma Network
</Badge>
<Badge
variant="secondary"
Expand All @@ -221,7 +214,7 @@ export function DomanitorDashboard() {
<Alert className="mb-6 border-accent bg-accent/10 rounded-lg">
<Activity className="h-4 w-4" />
<AlertDescription className="text-sm">
Connect your wallet to access Domanitor features and start tokenizing domains on Doma testnet.
Connect your wallet to access Domanitor features and start tokenizing domains on Doma Network.
<strong className="text-foreground"> All transactions are on testnet - no real funds required.</strong>
</AlertDescription>
</Alert>
Expand Down
20 changes: 15 additions & 5 deletions components/tokenization-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,23 @@ export function TokenizationPanel({ walletAddress, isConnected }: TokenizationPa
const handleTokenize = async () => {
if (!isConnected || !domain) return

const normalized = domain.trim().toLowerCase()
const parts = normalized.split('.')
const sld = parts[0]
const tld = parts.slice(1).join('.')
const domainRegex = /^[a-z0-9-]{1,63}\.[a-z0-9.-]{2,63}$/i
if (!sld || !tld || !domainRegex.test(normalized)) {
setError('Masukkan domain yang valid, mis. example.com')
return
}

setIsTokenizing(true)
setError("")
setTokenizationProgress(0)

try {
const request: TokenizationRequest = {
domain,
domain: normalized,
registrar: selectedRegistrar,
walletAddress,
fractionalize,
Expand Down Expand Up @@ -100,7 +110,7 @@ export function TokenizationPanel({ walletAddress, isConnected }: TokenizationPa
<CardContent className="space-y-4">
{!isConnected && (
<Alert>
<AlertDescription>Connect your wallet to start tokenizing domains on Doma testnet.</AlertDescription>
<AlertDescription>Connect your wallet to start tokenizing domains on Doma Network.</AlertDescription>
</Alert>
)}

Expand All @@ -126,7 +136,7 @@ export function TokenizationPanel({ walletAddress, isConnected }: TokenizationPa
<SelectValue placeholder="Select registrar" />
</SelectTrigger>
<SelectContent>
<SelectItem value="D3">D3 (Doma Testnet)</SelectItem>
<SelectItem value="D3">D3 (Doma Network)</SelectItem>
<SelectItem value="GoDaddy">GoDaddy</SelectItem>
<SelectItem value="Namecheap">Namecheap</SelectItem>
<SelectItem value="Cloudflare">Cloudflare</SelectItem>
Expand Down Expand Up @@ -205,7 +215,7 @@ export function TokenizationPanel({ walletAddress, isConnected }: TokenizationPa
<AlertDescription className="flex items-center gap-2">
<span>Transaction successful!</span>
<Button variant="ghost" size="sm" asChild>
<a href={`https://sepolia.etherscan.io/tx/${txHash}`} target="_blank" rel="noopener noreferrer">
<a href={`https://explorer-testnet.doma.xyz/tx/${txHash}`} target="_blank" rel="noopener noreferrer">
<ExternalLink className="h-3 w-3" />
View on Explorer
</a>
Expand Down Expand Up @@ -315,7 +325,7 @@ export function TokenizationPanel({ walletAddress, isConnected }: TokenizationPa
<Card>
<CardHeader>
<CardTitle>Recent Doma Protocol Activity</CardTitle>
<CardDescription>Latest domains tokenized on the Doma testnet</CardDescription>
<CardDescription>Latest domains tokenized on the Doma Network</CardDescription>
</CardHeader>
<CardContent>
<div className="mb-6">
Expand Down
Loading