7 lines
210 B
TypeScript
7 lines
210 B
TypeScript
|
import { PublicKey } from '@solana/web3.js'
|
||
|
|
||
|
export function abbreviateAddress(address: PublicKey, size = 5) {
|
||
|
const base58 = address.toBase58()
|
||
|
return base58.slice(0, size) + '…' + base58.slice(-size)
|
||
|
}
|