Skip to content

Commit 74e76fe

Browse files
committed
refactor(web): reuse the shared address formatter (#258)
1 parent 93ae815 commit 74e76fe

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

apps/web/src/hooks/useRoundSession.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright (c) 2026 Sub Rosa contributors
2+
import { shortAddr } from "../lib/format";
23
import { Buffer } from "buffer";
34
import { useEffect, useState } from "react";
45
import {
@@ -469,8 +470,3 @@ export function useRoundSession(active: UseCase) {
469470
refresh,
470471
};
471472
}
472-
473-
function shortAddr(addr: string, len = 6) {
474-
if (addr.length <= len * 2 + 3) return addr;
475-
return `${addr.slice(0, len)}${addr.slice(-len)}`;
476-
}

0 commit comments

Comments
 (0)