Skip to content

Function: createWalletFromBase58()

ts
function createWalletFromBase58(base58Key): Promise<Wallet>;

Create a wallet from a base58-encoded private key string.

This accepts the full 64-byte keypair encoded as base58, as commonly exported from wallets and tools like solana-keygen.

Parameters

ParameterTypeDescription
base58KeystringThe base58-encoded secret key string

Returns

Promise<Wallet>

A wallet created from the provided key

Example

ts
import { createWalletFromBase58 } from '@nosana/kit';

const wallet = await createWalletFromBase58(
  '5MaiiCavjCmn9Hs1o3eznqDEhRwxo7pXiAYez7keQUviUkauRiTMD8DrESdrNjN8zd9mTmVhRvBJeg5vhyvgrAhG'
);
console.log(wallet.address);