mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2026-09-29 17:15:03 -07:00
user agents
This commit is contained in:
@@ -274,6 +274,7 @@ export class StratumV1Client extends EasyUnsubscribe {
|
||||
sessionId: this.extraNonceAndSessionId,
|
||||
address: this.clientAuthorization.address,
|
||||
clientName: this.clientAuthorization.worker,
|
||||
userAgent: this.clientSubscription.userAgent,
|
||||
startTime: new Date(),
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { IsArray } from 'class-validator';
|
||||
import { Expose, Transform } from 'class-transformer';
|
||||
import { IsArray, IsString, MaxLength } from 'class-validator';
|
||||
|
||||
import { eRequestMethod } from '../enums/eRequestMethod';
|
||||
import { StratumBaseMessage } from './StratumBaseMessage';
|
||||
@@ -9,6 +10,14 @@ export class SubscriptionMessage extends StratumBaseMessage {
|
||||
@IsArray()
|
||||
params: string[];
|
||||
|
||||
@Expose()
|
||||
@IsString()
|
||||
@MaxLength(128)
|
||||
@Transform(({ value, key, obj, type }) => {
|
||||
return obj.params[0] == null ? 'default' : obj.params[0]
|
||||
})
|
||||
public userAgent: string;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.method = eRequestMethod.SUBSCRIBE;
|
||||
|
||||
Reference in New Issue
Block a user