sign js
This commit is contained in:
parent
3b4c620250
commit
e6b01e6b5c
19
signmsg.js
Normal file
19
signmsg.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const mnemonic = fs.readFileSync(".secret").toString().trim();
|
||||||
|
|
||||||
|
// web3.eth.defaultAccount = '0x50A8e60041A206AcaA5F844a1104896224be6F39'
|
||||||
|
const arbOneKey = fs.readFileSync(".key").toString().trim();
|
||||||
|
const arbOneAddr = fs.readFileSync(".addr").toString().trim();
|
||||||
|
|
||||||
|
const Web3 = require('web3');
|
||||||
|
|
||||||
|
const w3 = new Web3('https://arbitrum-one.public.blastapi.io')
|
||||||
|
|
||||||
|
const msg = 'some msg that need sign'
|
||||||
|
let res = w3.eth.accounts.sign(msg, arbOneKey)
|
||||||
|
|
||||||
|
console.log(res)
|
||||||
|
|
||||||
|
let hash = w3.eth.accounts.hashMessage(res.signature)
|
||||||
|
|
||||||
|
console.log(hash)
|
Loading…
x
Reference in New Issue
Block a user