extranonce2 8 bytes

This commit is contained in:
Ben
2026-05-06 18:18:34 -04:00
parent 9bf3dde862
commit cc0ca3979e
17 changed files with 83 additions and 64 deletions
@@ -1,7 +1,8 @@
import { Expose, Transform } from 'class-transformer';
import { ArrayMaxSize, ArrayMinSize, IsArray, IsString } from 'class-validator';
import { ArrayMaxSize, ArrayMinSize, IsArray, IsString, Length } from 'class-validator';
import { eRequestMethod } from '../enums/eRequestMethod';
import { EXTRANONCE2_SIZE_BYTES } from '../stratum.constants';
import { StratumBaseMessage } from './StratumBaseMessage';
import * as bitcoinjs from 'bitcoinjs-lib';
@@ -27,6 +28,7 @@ export class MiningSubmitMessage extends StratumBaseMessage {
public jobId: string;
@Expose()
@IsString()
@Length(EXTRANONCE2_SIZE_BYTES * 2, EXTRANONCE2_SIZE_BYTES * 2)
@Transform(({ value, key, obj, type }) => {
return obj.params[2];
})
@@ -75,4 +77,4 @@ export class MiningSubmitMessage extends StratumBaseMessage {
}
}