Skip to main content
Version: 6.0.1 - 6.0.2

setPrivateKey

Set a private key used with the OrgonWeb instance, used for obtaining the address, signing transactions, and getting balances.

❗️WARNING :

Do not use this with any web/user facing OrgonWeb instances. This will leak the private key.

Usage

OrgonWeb.setPrivateKey(private key);

Parameters

ParameterDescriptionData Type
private keyThe private key to be setString

Returns

No return value

Example

tronWeb.setPrivateKey('AD71C52E0FC0AB0DFB13B3B911624D4C1AB7BDEFAD93F36B6EF97DC955577509');
tronWeb.defaultPrivateKey
> 'AD71C52E0FC0AB0DFB13B3B911624D4C1AB7BDEFAD93F36B6EF97DC955577509'