This commit is contained in:
aozhiwei 2023-06-14 11:34:43 +08:00
parent e059c4b1f1
commit b070bab7ff

View File

@ -29,8 +29,15 @@ class BlockChain extends BaseService {
return this.#bc.getNftAddress(tokenType); return this.#bc.getNftAddress(tokenType);
} }
async soliditySha3Sign() { getUserAddress() {
return this.#bc.getUserAddress();
}
async soliditySha3Sign(...args) {
let signStr = await this.#bc.web3.utils.soliditySha3(...args);
let signature = await this.#bc.web3.eth.sign(signStr, this.getUserAddress());
signature = signature.replace(/00$/, "1b").replace(/01$/, "1c");
return signature;
} }
} }