Internal wallet state managed by O2Client.

Extends the Signer interface with the private key and wallet metadata. Returned by wallet generation/loading methods and passed to O2Client.setupAccount and O2Client.createSession.

const wallet = O2Client.generateWallet();
console.log(wallet.b256Address); // "0x..."
interface WalletState {
    b256Address: string;
    evmAddress?: string;
    isEvm: boolean;
    privateKey: Uint8Array;
    personalSign(message: Uint8Array): Uint8Array;
}

Hierarchy (View Summary)

Properties

b256Address: string

The Fuel B256 address (0x-prefixed, 64-char hex string).

evmAddress?: string

The EVM address (only present for EVM wallets).

isEvm: boolean

Whether this is an EVM-style wallet.

privateKey: Uint8Array

The wallet's private key (32 bytes).

Methods

  • Sign a message using the appropriate personal_sign format.

    For Fuel-native accounts: Fuel personalSign (\x19Fuel Signed Message:\n prefix + SHA-256).

    For EVM accounts: Ethereum personalSign (\x19Ethereum Signed Message:\n prefix + keccak256).

    Parameters

    • message: Uint8Array

      The raw message bytes to sign.

    Returns Uint8Array

    A 64-byte Fuel compact signature.