mining.configure optional

This commit is contained in:
Ben Wilson
2023-07-11 17:37:39 -04:00
parent ead1021dd6
commit 978a13a256
8 changed files with 572 additions and 12 deletions
+20 -2
View File
@@ -1,4 +1,22 @@
import { Controller } from '@nestjs/common';
import { Controller, Patch } from '@nestjs/common';
import * as bitcoinMessage from 'bitcoinjs-message';
@Controller('address')
export class AddressController {}
export class AddressController {
@Patch('settings')
async settings() {
const publicKey = '...'; // Public key corresponding to the private key used for signing
const message = '...'; // The message that was signed
const signature = '...'; // The signature of the message
const isValid: boolean = bitcoinMessage.verify(message, publicKey, signature);
if (isValid) {
console.log('Signature is valid!');
} else {
console.log('Signature is not valid!');
}
}
}