To simplify the process of building the whisper messages, a js file `status-gas-relayer.js` was created in the test-dapp. It only requires to setup connection to geth, and required keypairs and symkeys. This file might be expanded upon in the future and converted to a npm package.
## Use
```
import StatusGasRelayer, {Contracts, Functions, Messages} from 'status-gas-relayer';
General message subscription. Special handling is needed for handling relayer availability messages. The `sig` property is the relayer's public key that needs to be sent when sending a transaction message. More than 1 relayer can reply, so it's recommended to save these keys in a list/array.
Signing a message is similar to invoking a function. Both use mostly the same functions. The difference is that when you invoke a function, you need to specify the relayer and asymmetric key Id.
```
try {
const s = new StatusGasRelayer.Identity(identityAddress, accountAddress)
.setContractFunction(Functions.Identity.call)
.setTransaction(to, value, data)
.setGas(gasToken, gasPrice, gasLimit);
const signature = await s.sign(web3);
} catch(error){
console.log(error);
}
```
#### Using Identity contract `call` function
This functionality is used when a Identity will invoke a contract function or transfer ether without paying fees
```
try {
const s = new StatusGasRelayer.Identity(identityAddress, accountAddress)
.setContractFunction(Functions.Identity.call)
.setTransaction(to, value, data) // 'value' is in wei, and 'data' must be a hex string