mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
32 lines
874 B
TypeScript
32 lines
874 B
TypeScript
import { IsArray } from 'class-validator';
|
|
|
|
import { eRequestMethod } from '../enums/eRequestMethod';
|
|
import { StratumBaseMessage } from './StratumBaseMessage';
|
|
|
|
export class SubscriptionMessage extends StratumBaseMessage {
|
|
|
|
|
|
@IsArray()
|
|
params: string[];
|
|
|
|
constructor() {
|
|
super();
|
|
this.method = eRequestMethod.SUBSCRIBE;
|
|
}
|
|
|
|
public response(clientId: string) {
|
|
return {
|
|
id: this.id,
|
|
error: null,
|
|
result: [
|
|
[
|
|
['mining.notify', clientId]
|
|
],
|
|
clientId, //Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. Keep it safe!
|
|
4 //Extranonce2_size - Represents expected length of extranonce2 which will be generated by the miner.
|
|
]
|
|
}
|
|
|
|
|
|
}
|
|
} |