Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c89e02c
Add bot-runnable API tests and integration smoke suite
Andre-Diamond Mar 30, 2026
339a68b
feat: create new ci bot testing framework
Andre-Diamond Mar 31, 2026
91a21a2
Merge remote-tracking branch 'origin/main' into bot-api-test-suite
Andre-Diamond Mar 31, 2026
8863816
chore: update CI configuration and improve wallet transfer handling
Andre-Diamond Apr 1, 2026
086e0b7
chore: enhance CI documentation and improve transfer flow validation
Andre-Diamond Apr 2, 2026
6450fc0
fix: improve bot authentication error handling and enhance test setups
Andre-Diamond Apr 2, 2026
e3be4e1
chore: update CI workflow and enhance native script handling
Andre-Diamond Apr 3, 2026
2903976
Merge remote-tracking branch 'origin/main' into bot-api-test-suite
Andre-Diamond Apr 6, 2026
1b89b8b
chore: enhance CI workflows and improve transaction handling
Andre-Diamond Apr 6, 2026
42c090d
feat: expand wallet scopes and enhance CI documentation
Andre-Diamond Apr 6, 2026
33625bd
feat: add wallet balance summary to CI reports
Andre-Diamond Apr 13, 2026
444407c
Merge remote-tracking branch 'origin/main' into bot-api-test-suite
Andre-Diamond Apr 16, 2026
f40d261
refactor: restructure CI scripts and update documentation
Andre-Diamond Apr 16, 2026
3446801
refactor: update scenario functions to accept context parameter
Andre-Diamond Apr 17, 2026
e163562
feat: enhance CI wallet management and context handling
Andre-Diamond Apr 17, 2026
15830f2
Merge remote-tracking branch 'origin/main' into bot-api-test-suite
Andre-Diamond Apr 20, 2026
0afc497
feat: add bot stake and DRep certificate transaction endpoints
Andre-Diamond Apr 21, 2026
dde4f56
chore: update package-lock.json to mark several dependencies as dev d…
QSchlegel Apr 21, 2026
b96e8e7
docs: add roadmap and contributing guide
QSchlegel Apr 21, 2026
b835db4
Merge pull request #226 from MeshJS/docs/roadmap-and-contributing
QSchlegel Apr 21, 2026
e1d3044
feat: enhance transaction signing and certificate handling
Andre-Diamond Apr 23, 2026
b48e145
fix: guard against invalid CBOR in addTransaction and transaction card
QSchlegel Apr 23, 2026
cbd8790
docs: refresh M1 proof of completion to 2026-04-23
QSchlegel Apr 23, 2026
85d9653
Merge pull request #228 from MeshJS/docs/roadmap-m1-refresh-2026-04-23
QSchlegel Apr 23, 2026
e1ff118
fix: run prisma migrate deploy only at start, not build
QSchlegel Apr 23, 2026
0d16c71
Merge pull request #227 from MeshJS/fix/invalid-tx-cbor-211
QSchlegel Apr 23, 2026
d84d8f2
ci: trigger smoke tests on Railway deployment success
QSchlegel Apr 23, 2026
4a8fb70
Merge remote-tracking branch 'origin/main' into preprod
QSchlegel Apr 23, 2026
92dae4c
feat: update CI workflow to include additional branches for pull requ…
Andre-Diamond Apr 23, 2026
ac352ab
feat: add pre-hygiene step for DRep certificate management and implem…
Andre-Diamond Apr 24, 2026
c375af8
feat: enhance CI scenarios with new wallet lifecycle and negative tok…
Andre-Diamond Apr 24, 2026
7e1bff1
feat: update CI report format to Markdown and add cleanup step for te…
Andre-Diamond Apr 24, 2026
334b244
feat: remove bot-api-test-suite branch from PR workflow triggers
Andre-Diamond Apr 24, 2026
ba6fe35
Merge pull request #230 from MeshJS/bot-api-test-suite
QSchlegel Apr 24, 2026
7b3c9fb
feat: add retry logic for pulling base Docker image and update fetch …
Andre-Diamond Apr 24, 2026
d454730
docs: add comment to clarify validation of URL safety in resolveDRepA…
Andre-Diamond Apr 24, 2026
6cf87fb
docs: update comment to clarify URL validation process in resolveDRep…
Andre-Diamond Apr 24, 2026
093b6d5
feat: update DRep certificate handling to compute anchor data hash an…
Andre-Diamond Apr 24, 2026
d5b1de5
Merge pull request #231 from MeshJS/bot-api-test-suite
Andre-Diamond Apr 24, 2026
87feee0
feat: add CI_DREP_ANCHOR_JSON environment variable and update DRep re…
Andre-Diamond Apr 25, 2026
c08fb12
feat: update api README - DRep registration to require anchorJson in …
Andre-Diamond Apr 25, 2026
fdc77e8
feat: add CI_DREP_ANCHOR_JSON environment variable to workflow
Andre-Diamond Apr 25, 2026
8f14ac6
Merge pull request #232 from MeshJS/bot-api-test-suite
Andre-Diamond Apr 25, 2026
e3fc33c
feat: add proxy management endpoints and update test scripts
Andre-Diamond Apr 28, 2026
a710287
feat: enhance proxy bot functionality and update CI workflows
Andre-Diamond Apr 30, 2026
3175ce7
feat: enhance proxy bot lifecycle management and update documentation
Andre-Diamond Apr 30, 2026
8001b96
feat: enhance proxy lifecycle management to support hierarchical wallets
Andre-Diamond May 1, 2026
6171503
Merge pull request #234 from MeshJS/feature/add-proxy-api-and-ci-testing
Andre-Diamond May 1, 2026
6ba3628
feat: enhance DRep certificate handling and testing
Andre-Diamond May 19, 2026
0638acf
feat: integrate completeTxWithFreshCostModels into proxy transaction …
Andre-Diamond May 20, 2026
98f1ede
feat: add TRPC test command and update unit test workflow
Andre-Diamond May 20, 2026
84035f9
refactor: update completeTxWithFreshCostModels integration and enhanc…
Andre-Diamond May 21, 2026
478b160
feat: enhance proxy transaction handling with blocked UTxO management
Andre-Diamond May 21, 2026
52d5a5d
Refactor proxy UTxO selection and transaction building
Andre-Diamond May 22, 2026
e53308a
fix(signing): pin Mesh SDK + reject witnesses that don't verify again…
QSchlegel May 24, 2026
f78dee7
fix(deps): pin libsodium-wrappers-sumo to 0.7.10 to unbreak Node ESM …
QSchlegel May 24, 2026
d6c2690
fix: pin Mesh to preprod's resolved versions + recover wallet body on…
QSchlegel May 24, 2026
ee28b4d
fix(deps): regenerate lockfile with npm 10.8.2 to match CI's Node 20 …
QSchlegel May 24, 2026
6c6c001
fix(deps): pin @peculiar/webcrypto to 1.5.0 to keep Vercel webpack bu…
QSchlegel May 24, 2026
fa49308
feat: integrate completeTxWithFreshCostModels into proxy transaction …
Andre-Diamond May 20, 2026
b1199d8
refactor: update completeTxWithFreshCostModels integration and enhanc…
Andre-Diamond May 21, 2026
8835b95
Merge pull request #257 from MeshJS/fix/witness-signature-mismatch-pr…
QSchlegel May 24, 2026
3c47952
Merge branch 'preprod' into refactor/ci-and-browser-tx-building-align…
Andre-Diamond May 25, 2026
5eb23bc
feat(wallets): add Import Wallet wizard
QSchlegel May 25, 2026
4d91e59
fix(wallets): drop audit() call from importWallet on preprod
QSchlegel May 25, 2026
6fca533
Merge pull request #259 from MeshJS/claude/feat-import-wallet-preprod
QSchlegel May 25, 2026
873ecb7
Merge origin/main into preprod (PR #229)
QSchlegel May 25, 2026
0801d4d
fix: restore main-only schema/code lost by the auto-merge
QSchlegel May 26, 2026
820f775
Merge pull request #260 from MeshJS/claude/resolve-pr229
QSchlegel May 28, 2026
a032b69
refactor: streamline multisig wallet address handling and improve err…
Andre-Diamond May 28, 2026
a63518f
feat: Enhance proxy lifecycle and transaction handling
Andre-Diamond May 28, 2026
5ba0c4b
Merge pull request #256 from MeshJS/refactor/ci-and-browser-tx-buildi…
Andre-Diamond May 29, 2026
d8dd23f
Merge main into preprod: Prisma 7 + mesh 2.0 migration + test-infra f…
QSchlegel Jun 9, 2026
eeca1b6
Merge main into preprod
QSchlegel Jun 9, 2026
5ec7d75
test(freeUtxos): drop virtual:true from module mocks to fix flakiness
QSchlegel Jun 9, 2026
015fc72
diag: instrument ballot vote witness/body-hash divergence (#271)
QSchlegel Jun 9, 2026
95f67d9
feat(governance): in-app Ekklesia/Hydra budget voting for multisig DR…
QSchlegel Jun 9, 2026
ff09d59
fix(auth): normalize hex-encoded CIP-30 addresses to bech32 before us…
QSchlegel Jun 11, 2026
3e185f9
fix(import): make cross-instance import work from mobile and other or…
QSchlegel Jun 11, 2026
fa159de
diag(auth): surface real wallet signData error instead of generic mes…
QSchlegel Jun 12, 2026
242a842
diag(auth): always show raw signData error, drop false-matching cance…
QSchlegel Jun 12, 2026
b41a11c
fix(auth): use Mesh 1.9 wallet so signData args aren't swapped (VESPR…
QSchlegel Jun 12, 2026
37d3322
refactor(wallet): consolidate all wallet ops on the Mesh 1.9 bridge +…
QSchlegel Jun 12, 2026
773edc3
fix(governance): detect on-chain DRep registration in Hydra budget vo…
QSchlegel Jun 12, 2026
131b266
Merge main into preprod (resolve squash-merge conflicts from #229; pr…
QSchlegel Jun 13, 2026
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
17 changes: 17 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,23 @@ export default [
},
},
rules: {
// Guardrail: never pull `wallet` out of @meshsdk/react 2.0's useWallet().
// That object is a low-level CIP-30 wallet whose signData(address, payload)
// / signTx(tx, partialSign) signatures differ from the @meshsdk/core 1.9
// IWallet the app is built on — a wrong-order call compiles but signs the
// wrong bytes (caused VESPR CIP-30 InternalError -2 and ballot witness
// divergence). Use useMeshWallet()/useActiveWallet() for any wallet ops;
// useWallet() is fine for connection state only (name/connected/connect/
// disconnect).
"no-restricted-syntax": [
"error",
{
selector:
"VariableDeclarator[init.callee.name='useWallet'] > ObjectPattern > Property[key.name='wallet']",
message:
"Don't destructure `wallet` from @meshsdk/react useWallet() — its signData/signTx args differ from core 1.9 and silently sign wrong bytes. Use useMeshWallet()/useActiveWallet() instead.",
},
],
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/consistent-type-imports": [
Expand Down
39 changes: 39 additions & 0 deletions src/__tests__/addressCompatibility.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { describe, it, expect } from '@jest/globals';
import { normalizeAddressToBech32 } from '../utils/addressCompatibility';

describe('normalizeAddressToBech32', () => {
// 57-byte mainnet base address as returned hex-encoded by some CIP-30
// wallets (mobile in-app browsers) from getChangeAddress/getUsedAddresses.
const mainnetBaseHex =
'01188691447471593ad888086cd3cffcb93833f38225ebd56bb1986476b59d6e7bd1e5ae3ae5ffe52dada5528d868ef67b738687543193df8d';
const mainnetBaseBech32 =
'addr1qyvgdy2yw3c4jwkc3qyxe570ljunsvlnsgj7h4ttkxvxga44n4h8h5094cawtll99kk6255ds680v7mns6r4gvvnm7xscrhvw9';

it('converts hex-encoded mainnet base address bytes to bech32', () => {
expect(normalizeAddressToBech32(mainnetBaseHex)).toBe(mainnetBaseBech32);
});

it('converts hex-encoded testnet base address bytes to addr_test', () => {
const testnetHex = '00' + mainnetBaseHex.slice(2);
expect(normalizeAddressToBech32(testnetHex)).toMatch(/^addr_test1/);
});

it('converts hex-encoded reward address bytes to stake bech32', () => {
const rewardHex = 'e1ad675b9ef479ae3ae5ffe52dada5528d868ef67b738687543193df8d';
expect(normalizeAddressToBech32(rewardHex)).toBe(
'stake1uxkkwku773u6uwh9lljjmtd922xcdrhk0decdp65xxfalrgc9mvct',
);
});

it('returns bech32 addresses unchanged', () => {
expect(normalizeAddressToBech32(mainnetBaseBech32)).toBe(mainnetBaseBech32);
const stake = 'stake1uxkkwku773u6uwh9lljjmtd922xcdrhk0decdp65xxfalrgc9mvct';
expect(normalizeAddressToBech32(stake)).toBe(stake);
});

it('returns non-address input unchanged', () => {
expect(normalizeAddressToBech32('deadbeef')).toBe('deadbeef');
expect(normalizeAddressToBech32('not-an-address')).toBe('not-an-address');
expect(normalizeAddressToBech32('')).toBe('');
});
});
50 changes: 6 additions & 44 deletions src/components/common/cardano-objects/connect-wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ import React from "react";
import useUser from "@/hooks/useUser";
import { useUserStore } from "@/lib/zustand/user";
import { getProvider } from "@/utils/get-provider";
import {
Asset,
deserializeAddress,
pubKeyAddress,
scriptAddress,
serializeAddressObj,
serializeRewardAddress,
} from "@meshsdk/core";
import { Asset } from "@meshsdk/core";
import { normalizeAddressToBech32 } from "@/utils/addressCompatibility";
import useUTXOS from "@/hooks/useUTXOS";
import { api } from "@/utils/api";
import { useWalletContext, WalletState } from "@/hooks/useWalletContext";
Expand Down Expand Up @@ -405,23 +399,7 @@ function ConnectWalletContent({
}

// Normalize possible hex-encoded CIP-30 address bytes to bech32 (addr/addr_test)
try {
if (!address.startsWith("addr1") && !address.startsWith("addr_test1")) {
const d = deserializeAddress(address);
const stakeCredential = d.stakeCredentialHash || d.stakeScriptCredentialHash || "";
const rebuilt =
d.pubKeyHash
? pubKeyAddress(d.pubKeyHash, stakeCredential, !!d.stakeScriptCredentialHash)
: d.scriptHash
? scriptAddress(d.scriptHash, stakeCredential, !!d.stakeScriptCredentialHash)
: null;
if (rebuilt) {
address = serializeAddressObj(rebuilt, netId);
}
}
} catch {
// If normalization fails, keep original (better than dropping the address)
}
address = normalizeAddressToBech32(address);

setUserAddress(address);

Expand All @@ -430,24 +408,8 @@ function ConnectWalletContent({
let stakeAddress = stakeAddresses[0];

// Normalize possible hex-encoded reward address bytes to bech32 (stake/stake_test)
try {
if (
stakeAddress &&
!stakeAddress.startsWith("stake1") &&
!stakeAddress.startsWith("stake_test1")
) {
const d = deserializeAddress(stakeAddress);
const stakeHash = d.stakeCredentialHash || d.stakeScriptCredentialHash;
if (stakeHash) {
stakeAddress = serializeRewardAddress(
stakeHash,
!!d.stakeScriptCredentialHash,
netId,
);
}
}
} catch {
// ignore
if (stakeAddress) {
stakeAddress = normalizeAddressToBech32(stakeAddress);
}

if (!stakeAddress || !address) {
Expand Down Expand Up @@ -483,7 +445,7 @@ function ConnectWalletContent({
utxosInitializedRef.current = false;
}
})();
}, [isUtxosEnabled, utxosWallet, isUserLoading, createUser, setUserAddress, netId]);
}, [isUtxosEnabled, utxosWallet, isUserLoading, createUser, setUserAddress]);

// Handle UTXOS wallet assets and network
useEffect(() => {
Expand Down
77 changes: 38 additions & 39 deletions src/components/common/modals/WalletAuthModal.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { useState, useEffect, useCallback } from "react";
import { useWallet } from "@meshsdk/react";
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { useToast } from "@/hooks/use-toast";
import useUTXOS from "@/hooks/useUTXOS";
import { useSiteStore } from "@/lib/zustand/site";
import { deserializeAddress, pubKeyAddress, scriptAddress, serializeAddressObj } from "@meshsdk/core";
import useMeshWallet from "@/hooks/useMeshWallet";
import { normalizeAddressToBech32 } from "@/utils/addressCompatibility";

interface WalletAuthModalProps {
address: string; // display label; actual signing address is derived from wallet.getUsedAddresses()
Expand All @@ -16,9 +15,16 @@ interface WalletAuthModalProps {
}

export function WalletAuthModal({ address, open, onClose, onAuthorized, autoAuthorize = false }: WalletAuthModalProps) {
const { wallet, connected } = useWallet();
const network = useSiteStore((state) => state.network);
const netId = (network === 1 ? 1 : 0) as 0 | 1;
// Use the Mesh 1.9 BrowserWallet (via useMeshWallet), NOT react-2.0's
// useWallet().wallet. The latter is a low-level CIP-30 wallet whose
// signData(address, payload) argument order is SWAPPED relative to 1.9's
// signData(payload, address). Calling it with our (nonce, address) order
// made wallets (e.g. VESPR) sign with the nonce as the address and throw
// CIP-30 InternalError (-2). The 1.9 wallet matches the (payload, address)
// order used everywhere else in the app, and the UTXOS MeshWallet below is
// also payload-first — so a single signData(nonce, address) call is correct
// for both.
const { wallet: meshWallet, connected } = useMeshWallet();
const { wallet: utxosWallet, isEnabled: isUtxosEnabled } = useUTXOS();
const { toast } = useToast();
const [submitting, setSubmitting] = useState(false);
Expand All @@ -27,22 +33,7 @@ export function WalletAuthModal({ address, open, onClose, onAuthorized, autoAuth
const signingWallet =
isUtxosEnabled && utxosWallet?.cardano
? utxosWallet.cardano
: (wallet && connected ? wallet : null);

const normalizePaymentAddress = useCallback((maybeHexOrBech: string): string => {
if (maybeHexOrBech.startsWith("addr1") || maybeHexOrBech.startsWith("addr_test1")) {
return maybeHexOrBech;
}
const d = deserializeAddress(maybeHexOrBech);
const stakeCredential = d.stakeCredentialHash || d.stakeScriptCredentialHash || "";
const rebuilt =
d.pubKeyHash
? pubKeyAddress(d.pubKeyHash, stakeCredential, !!d.stakeScriptCredentialHash)
: d.scriptHash
? scriptAddress(d.scriptHash, stakeCredential, !!d.stakeScriptCredentialHash)
: null;
return rebuilt ? serializeAddressObj(rebuilt, netId) : maybeHexOrBech;
}, [netId]);
: (meshWallet && connected ? meshWallet : null);

const handleAuthorize = useCallback(async () => {
if (!signingWallet) {
Expand Down Expand Up @@ -95,7 +86,10 @@ export function WalletAuthModal({ address, open, onClose, onAuthorized, autoAuth
if (!signingAddress) {
throw new Error("No addresses found for wallet");
}
signingAddress = normalizePaymentAddress(signingAddress);
signingAddress = normalizeAddressToBech32(signingAddress);
if (!signingAddress.startsWith("addr1") && !signingAddress.startsWith("addr_test1")) {
throw new Error("Could not read a valid payment address from this wallet.");
}

// 1) Get nonce from existing endpoint
const nonceRes = await fetch(`/api/v1/getNonce?address=${encodeURIComponent(signingAddress)}`);
Expand All @@ -113,26 +107,31 @@ export function WalletAuthModal({ address, open, onClose, onAuthorized, autoAuth

let signed: { signature: string; key: string } | undefined;
try {
// Mirror the working Swagger token flow: signData(nonce, address)
// Mesh 1.9 / UTXOS order is signData(payload, address).
signed = (await (signingWallet as any).signData(
nonce,
signingAddress,
)) as { signature: string; key: string };
} catch (error: any) {
if (error instanceof Error) {
const msg = error.message.toLowerCase();
if (
msg.includes("user") ||
msg.includes("cancel") ||
msg.includes("decline") ||
msg.includes("reject")
) {
throw new Error(
"Signing cancelled. Please try again and approve the signing request.",
);
}
}
throw new Error("Failed to sign nonce. Please try again.");
const raw =
error instanceof Error
? error.message
: typeof error === "string"
? error
: (() => {
try {
return JSON.stringify(error);
} catch {
return String(error);
}
})();
// Surface the wallet's real error verbatim — some (e.g. the UTXOS
// smart wallet) fail inside signData with a provider-specific
// message we otherwise lose. The previous cancel/reject heuristic
// false-matched non-cancellation errors that merely contained the
// word "user", hiding the true cause, so always show the raw text.
console.error("[WalletAuthModal] signData failed:", error);
throw new Error(`Failed to sign nonce: ${raw || "unknown wallet error"}`);
}

if (!signed?.signature || !signed?.key) {
Expand Down Expand Up @@ -171,7 +170,7 @@ export function WalletAuthModal({ address, open, onClose, onAuthorized, autoAuth
} finally {
setSubmitting(false);
}
}, [signingWallet, toast, onAuthorized, onClose, normalizePaymentAddress]);
}, [signingWallet, toast, onAuthorized, onClose]);

// Auto-authorize when modal opens if autoAuthorize is true (only once)
useEffect(() => {
Expand Down
13 changes: 6 additions & 7 deletions src/components/common/overall-layout/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, Component, ReactNode, useMemo, useCallback, useState, useRef } from "react";
import { useRouter } from "next/router";
import Link from "next/link";
import { useWallet, useAddress } from "@meshsdk/react";
import { useAddress } from "@meshsdk/react";
import { publicRoutes } from "@/data/public-routes";
import { api } from "@/utils/api";
import useUser from "@/hooks/useUser";
Expand Down Expand Up @@ -99,7 +99,6 @@ export default function RootLayout({
}: {
children: React.ReactNode;
}) {
const { wallet } = useWallet();
// 1.9 IWallet bridge — used for getDRep(), which the react 2.0 wallet lacks.
const { wallet: meshWallet } = useMeshWallet();
const { state: walletState, connectedWalletInstance } = useWalletContext();
Expand All @@ -124,9 +123,9 @@ export default function RootLayout({
const connected = String(walletState) === String(WalletState.CONNECTED);
const anyWalletConnected = connected || isUtxosEnabled;
// Use connectedWalletInstance if available, otherwise fall back to wallet
const activeWallet = connectedWalletInstance && Object.keys(connectedWalletInstance).length > 0
? connectedWalletInstance
: wallet;
const activeWallet = connectedWalletInstance && Object.keys(connectedWalletInstance).length > 0
? connectedWalletInstance
: meshWallet;

// Global error handler for unhandled promise rejections
useEffect(() => {
Expand Down Expand Up @@ -289,8 +288,8 @@ export default function RootLayout({
}

async function initializeWallet() {
if (!walletAddress) return;
if (!walletAddress || !activeWallet) return;

try {
// Get stake address
const stakeAddresses = await activeWallet.getRewardAddresses();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useWallet } from "@meshsdk/react";
import useMeshWallet from "@/hooks/useMeshWallet";
import { useToast } from "@/hooks/use-toast";
import { useRouter } from "next/router";
import { useUserStore } from "@/lib/zustand/user";
Expand All @@ -24,7 +25,10 @@ export default function UserDropDownWrapper({
mode,
onAction
}: UserDropDownWrapperProps) {
const { wallet, connected, disconnect } = useWallet();
// useWallet only for connection state/control; wallet ops go through the
// Mesh 1.9 bridge.
const { connected, disconnect } = useWallet();
const { wallet } = useMeshWallet();
const { wallet: utxosWallet, isEnabled: isUtxosEnabled, disable: disableUtxos } = useUTXOS();
const { toast } = useToast();
const router = useRouter();
Expand Down
8 changes: 7 additions & 1 deletion src/components/common/overall-layout/user-drop-down.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { useWallet } from "@meshsdk/react";
import useMeshWallet from "@/hooks/useMeshWallet";
import { useToast } from "@/hooks/use-toast";
import { useRouter } from "next/router";
import { useUserStore } from "@/lib/zustand/user";
import { api } from "@/utils/api";

export default function UserDropDown() {
const { wallet, disconnect } = useWallet();
// useWallet only for connection control (disconnect); wallet ops go
// through the Mesh 1.9 bridge.
const { disconnect } = useWallet();
const { wallet } = useMeshWallet();
const { toast } = useToast();
const router = useRouter();
const setPastWallet = useUserStore((state) => state.setPastWallet);
Expand All @@ -42,6 +46,7 @@ export default function UserDropDown() {

async function unlinkDiscord(): Promise<void> {
try {
if (!wallet) return;
const usedAddresses = await wallet.getUsedAddresses();
const address = usedAddresses[0];
unlinkDiscordMutation.mutate({ address: address ?? "" });
Expand Down Expand Up @@ -84,6 +89,7 @@ export default function UserDropDown() {
<DropdownMenuItem
onClick={async () => {
try {
if (!wallet) return;
let userAddress: string | undefined;
try {
const usedAddresses = await wallet.getUsedAddresses();
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/homepage/governance/drep/id/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TooltipProvider } from "@/components/ui/tooltip";
import { Loader } from "lucide-react";
import ActiveIndicator from "../activeIndicator";
import ScriptIndicator from "../scriptIndicator";
import { useWallet } from "@meshsdk/react";
import useMeshWallet from "@/hooks/useMeshWallet";
import RowLabelInfo from "@/components/common/row-label-info";
import { extractJsonLdValue } from "@/utils/jsonLdParser";
import { Button } from "@/components/ui/button";
Expand All @@ -17,7 +17,7 @@ import DelegateButton from "./delegateButton";
export default function DrepDetailPage() {
const router = useRouter();
const { id } = router.query;
const { wallet, connected } = useWallet();
const { wallet, connected } = useMeshWallet();
const [drepInfo, setDrepInfo] = useState<BlockfrostDrepInfo | null>(null);
const [drepMetadata, setDrepMetadata] =
useState<BlockfrostDrepMetadata | null>(null);
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/homepage/governance/drep/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Pagination from "@/components/common/overall-layout/pagination";
import { getProvider } from "@/utils/get-provider";
import { BlockfrostDrepInfo, BlockfrostDrepMetadata } from "@/types/governance";
import Link from "next/link";
import { useWallet } from "@meshsdk/react";
import useMeshWallet from "@/hooks/useMeshWallet";
import DelegateButton from "./id/delegateButton";
import RowLabelInfo from "@/components/common/row-label-info";
import { TooltipProvider } from "@/components/ui/tooltip";
Expand All @@ -16,7 +16,7 @@ export default function DrepOverviewPage() {
Array<{ details: BlockfrostDrepInfo; metadata: BlockfrostDrepMetadata | null }>
>([]);
const [loading, setLoading] = useState<boolean>(true);
const { wallet, connected } = useWallet();
const { wallet, connected } = useMeshWallet();
const [currentPage, setCurrentPage] = useState<number>(1);
const [pageSize, setPageSize] = useState<number>(25);
const [order, setOrder] = useState<"asc" | "desc">("asc");
Expand Down
Loading
Loading