Skip to content

HdKey.fromJson

Creates a HD Key from a JSON object containing an extended private key (xpriv).

Imports

Named
import { HdKey } from 'ox'

Examples

import { HdKey } from 'ox'
 
const hdKey = HdKey.fromJson({ xpriv: '...' })
 
console.log(hdKey.privateKey)
'0x...'

Definition

function fromJson(
  json: {
    xpriv: string;
},
): HdKey

Source: src/HdKey.ts

Parameters

json

  • Type: { xpriv: string; }

The JSON object containing an extended private key (xpriv).

Return Type

The HD Key.

HdKey.HdKey