Methods
(static) addof(pri) → {string}
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}
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}
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'
// }