btcutil-js - v0.2.0
    Preparing search index...

    Variable wifConst

    wif: {
        decode(wifStr: string): Promise<WifDecodeResult>;
        encode(
            privateKey: Bytes,
            network?: Network,
            compress?: boolean,
        ): Promise<string>;
    } = ...

    Wallet Import Format encoding and decoding.

    Type Declaration

    • decode: function
      • Decode a WIF-encoded private key string. Calls Go: btcutil.DecodeWIF() from btcutil.

        Parameters

        • wifStr: string

        Returns Promise<WifDecodeResult>

    • encode: function
      • Encode a private key (hex) as a WIF string. Calls Go: btcutil.NewWIF() from btcutil (via btcec.PrivKeyFromBytes()).

        Parameters

        • privateKey: Bytes
        • network: Network = 'mainnet'
        • compress: boolean = true

          Whether to use compressed public key (default: true).

        Returns Promise<string>