(tmAddress, nonce, validFrom, expiry, fromAddress, toAddress, amount, pk)
| 3 | let BN = Web3.utils.BN; |
| 4 | |
| 5 | function getSignSTMData(tmAddress, nonce, validFrom, expiry, fromAddress, toAddress, amount, pk) { |
| 6 | let hash = web3.utils.soliditySha3({ |
| 7 | t: 'address', |
| 8 | v: tmAddress |
| 9 | }, { |
| 10 | t: 'uint256', |
| 11 | v: new BN(nonce) |
| 12 | }, { |
| 13 | t: 'uint256', |
| 14 | v: new BN(validFrom) |
| 15 | }, { |
| 16 | t: 'uint256', |
| 17 | v: new BN(expiry) |
| 18 | }, { |
| 19 | t: 'address', |
| 20 | v: fromAddress |
| 21 | }, { |
| 22 | t: 'address', |
| 23 | v: toAddress |
| 24 | }, { |
| 25 | t: 'uint256', |
| 26 | v: new BN(amount) |
| 27 | }); |
| 28 | let signature = (web3.eth.accounts.sign(hash, pk)).signature; |
| 29 | let data = web3.eth.abi.encodeParameters( |
| 30 | ['address', 'uint256', 'uint256', 'uint256', 'bytes'], |
| 31 | [tmAddress, new BN(nonce).toString(), new BN(validFrom).toString(), new BN(expiry).toString(), signature] |
| 32 | ); |
| 33 | return data; |
| 34 | } |
| 35 | |
| 36 | async function getFreezeIssuanceAck(stAddress, from) { |
| 37 | const typedData = { |
no outgoing calls
no test coverage detected