RpcSystemAssetTracker/CronContractInvoker.cs
/// <summary>
/// Derives an address and keys from given private key 
/// </summary>
/// <param name="privKey">HEX or WIF private key to derive address from</param>
/// <returns>An object with address and its keys in different formats</returns>
///  
Derives an address and keys from given private key
Derives an address and keys from given private key
private JObject GetAddress(string privKey)
        {
            JObject obj = new JObject();
            KeyPair kp = new KeyPair(privKey.ToBytePrivateKey());
            var address = kp.AsAddress();
            obj["wif"] = kp.Export();
            obj["address"] = address;
            obj["privkey"] = kp.PrivateKey.ToHexString();
            obj["pubkey"] = kp.PublicKey.ToString();
            obj["scripthash"] = address.ToScriptHash().ToString();
            return obj;
        }
private JObject GetAddress ( string privKey ) { JObject obj = new JObject ( ) ; KeyPair kp = new KeyPair ( privKey . ToBytePrivateKey ( ) ) ; var address = kp . AsAddress ( ) ; obj [ " " ] = kp . Export ( ) ; obj [ " " ] = address ; obj [ " " ] = kp . PrivateKey . ToHexString ( ) ; obj [ " " ] = kp . PublicKey . ToString ( ) ; obj [ " " ] = address . ToScriptHash ( ) . ToString ( ) ; return obj ; }
Derives an address and keys from given private key
Derives an address and keys from given private key
An object with address and its keys in different formats
An object with address and its keys in different formats
privKey
string
HEX or WIF private key to derive address from
HEX or WIF private key to derive address from