Methods
constructWeb3()
This function constructs Web3 http provider
Parameters:
Name | Type | Description |
---|---|---|
newWeb3.providers.HttpProvider(providerUrl |
Web3.HttpProvider |
decode(str)
This function decodes json string to json object
Parameters:
Name | Type | Description |
---|---|---|
str |
String |
encode(data)
This function encodes json object to json string
Parameters:
Name | Type | Description |
---|---|---|
data |
Any |
getSymmetricKey(web3, account, salt)
This function generates symmetric key based
Parameters:
Name | Type | Description |
---|---|---|
web3 |
web3.providers | Web3 provider |
account |
web3.account | Web3 account object |
salt |
Int | Integer for more randomness |
(async) sigDecrypt(web3, account, cipher, salt)
This function decrypts encrypted and signed message
Parameters:
Name | Type | Description |
---|---|---|
web3 |
web3.providers | Web3 provider |
account |
web3.account | Web3 account object |
cipher |
Int | Shared symmetric key |
salt |
Int | Integer for more randomness |
Returns:
result TODO: Confirm type here
(async) sigEncrypt(web3, account, msg, salt)
This function encrypts and signs the message
Parameters:
Name | Type | Description |
---|---|---|
web3 |
web3.providers | Web3 provider |
account |
web3.account | Web3 account object |
msg |
String | Message to send |
salt |
Int | Integer for more randomness |
Returns:
cipher TODO: Confirm type here