mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
mining.configure optional
This commit is contained in:
@@ -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!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user