@@ -6,14 +6,14 @@ import type { BeeRequestOptions } from '../types'
66import { GsocEphemeralParams , PubsubMode , PubsubTopicListResponse } from '../types'
77import { Bytes } from '../utils/bytes'
88import { http } from '../utils/http'
9- import { EthAddress , Identifier , PrivateKey , Signature } from '../utils/typed-bytes'
9+ import { EthAddress , Identifier , PrivateKey , Signature , Span } from '../utils/typed-bytes'
1010import { NULL_IDENTIFIER } from '../utils/constants'
1111
1212const endpoint = 'pubsub'
1313const ENCODER = new TextEncoder ( )
1414
1515const SIG_SIZE = Signature . LENGTH
16- const SPAN_WS_SIZE = 4
16+ const SPAN_WS_SIZE = Span . LENGTH
1717
1818export interface IPubsubMode {
1919 readonly topicAddress : string
@@ -99,9 +99,7 @@ export class GsocEphemeralMode implements IPubsubMode {
9999 throw new Error ( 'Cannot encode messages in subscriber-only mode (no signer available)' )
100100 }
101101
102- const span4 = cac . span . toUint8Array ( ) . slice ( 0 , SPAN_WS_SIZE )
103-
104- return Binary . concatBytes ( sigBytes , span4 , cac . payload . toUint8Array ( ) )
102+ return Binary . concatBytes ( sigBytes , cac . span . toUint8Array ( ) , cac . payload . toUint8Array ( ) )
105103 }
106104
107105 decodeMessage ( frame : Uint8Array ) : Bytes {
0 commit comments