key

key

Source:

Methods

(static) addof(pri) → {string}

Source:
Parameters:
Name Type Description
pri string

Privatekey whose address will be calculated

Returns:
Type:
string

Address of private key

Example
key.addof('0x51ec37a9351c96a1886f2d951e7f51f3069d0b4f1373b74fb69f91db76623f63')
// returns
// '0x51ec37a9351c96a1886f2d951e7f51f3069d0b4f1373b74fb69f91db76623f63'

(static) shard(address) → {number}

Source:
Parameters:
Name Type Description
address string

Address whose shard will be calculated

Returns:
Type:
number

Shard of address

Example
key.shard('0xcc5d9fb5712c17222686b55cad068ecf1dd4f1f1')
// returns
// 1

(static) spawn(targetShard) → {object}

Source:
Parameters:
Name Type Description
targetShard number

Target shard

Returns:
Type:
object

PrivateKey and address from shard

Example
key.spawn(1)
// returns
// {
//   address: '0xcc5d9fb5712c17222686b55cad068ecf1dd4f1f1',
//   privateKey: '0x51ec37a9351c96a1886f2d951e7f51f3069d0b4f1373b74fb69f91db76623f63'
// }

(static) valid(add) → {string}

Source:
Parameters:
Name Type Description
add string

Address to be verified

Returns:
Type:
string

Validity of address

Example
key.valid('0x03bcaf796fe8cffd90d1245667921ab83a3a43e1')
// returns
// true