Constructors

Properties

lastEphemeralKeyPair: null | EphemeralKeyPair = null
lastMethodUsed: "unknown" | "standard" | "legacy" = "unknown"
logs: LogMessage[] = []
STEALTH_DATA_TABLE: string
STEALTH_HISTORY_KEY: "stealthHistory"
storage: ShogunStorage

Methods

  • Cleanup sensitive data from memory

    Returns Promise<void>

  • Derives a wallet from shared secret

    Parameters

    • secret: string

    Returns Wallet

  • Removes the initial tilde (~) from the public key if present

    Parameters

    • publicKey: null | string

    Returns null | string

  • Generates a new ephemeral key pair for stealth transactions

    Returns Promise<{ privateKey: string; publicKey: string }>

    Promise with the generated key pair

  • Implementazione originale di generateStealthAddress

    Parameters

    • recipientPublicKey: string

      Recipient's public key

    • OptionalephemeralPrivateKey: string

      Ephemeral private key (optional)

    Returns Promise<StealthAddressResult>

    Promise with the stealth address result

  • Genera una coppia di chiavi stealth - necessaria per i test aggiuntivi

    Returns {
        scanning: { privateKey: string; publicKey: string };
        spending: { privateKey: string; publicKey: string };
    }

  • Genera metadati stealth - necessario per i test

    Parameters

    • ephemeralPublicKey: string
    • stealthAddress: string

    Returns any

  • Gets public key from an address

    Parameters

    • publicKey: string

    Returns Promise<null | string>

  • Gets the private key for a stealth address

    Parameters

    • stealthData: StealthData

      Stealth data

    • privateKeyOrSpendKey: string

      User's private key or spend key

    Returns Promise<string>

    Promise with the derived private key

  • Checks if a stealth address belongs to the user

    Parameters

    • stealthData: StealthData

      Stealth data to check

    • privateKeyOrSpendKey: string

      User's private key or spend key

    Returns Promise<boolean>

    Promise resolving to boolean indicating ownership

  • Structured logging system

    Parameters

    • level: LogLevel
    • message: string
    • Optionaldata: any

    Returns void

  • Opens a stealth address by deriving the private key

    Parameters

    Returns Promise<Wallet>

  • Standard method to open a stealth address (used as fallback)

    Parameters

    Returns Promise<Wallet>

  • Saves stealth data in storage with validation

    Parameters

    Returns void

  • Converte una chiave di scansione in chiave privata - necessario per i test

    Parameters

    • scanningPrivateKey: string
    • spendingPrivateKey: string
    • ephemeralPublicKey: string

    Returns string

  • Scans a list of stealth addresses to find ones belonging to the user

    Parameters

    • addresses: StealthData[]

      Array of stealth data to scan

    • privateKeyOrSpendKey: string

      User's private key or spend key

    Returns Promise<StealthData[]>

    Promise with array of stealth data that belongs to the user

  • Validate stealth data

    Parameters

    Returns boolean

  • Utilizzato per verificare un indirizzo stealth - necessario per i test

    Parameters

    • ephemeralPublicKey: string
    • scanningPublicKey: string
    • spendingPublicKey: string
    • stealthAddress: string

    Returns boolean