Interface for objects that can sign messages for the O2 Exchange.

Both built-in wallets (Wallet, EvmWallet) and external signers (ExternalSigner, ExternalEvmSigner) satisfy this interface. For custom signing backends (hardware wallets, AWS KMS, HSMs, etc.), implement this interface directly or use the provided external signer classes.

// Using the built-in wallet (implements Signer)
const wallet = client.generateWallet();
await client.createSession(wallet, ["fFUEL/fUSDC"]);

// Using an external signer
const signer = new ExternalSigner("0x1234...abcd", myKmsSignDigest);
await client.createSession(signer, ["fFUEL/fUSDC"]);
interface Signer {
    b256Address: string;
    personalSign(message: Uint8Array): Uint8Array;
}

Hierarchy (View Summary)

Implemented by

Properties

Methods

Properties

b256Address: string

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

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.