Skip to content

Commit

Permalink
fix: add abort options to echo
Browse files Browse the repository at this point in the history
Adds optional `AbortOptions` to interface, not sure why this wasn't there before.
  • Loading branch information
achingbrain authored Nov 6, 2024
1 parent 9168799 commit 1bd2cc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/protocol-echo/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
*/

import { Echo as EchoClass } from './echo.js'
import type { ComponentLogger, PeerId } from '@libp2p/interface'
import type { AbortOptions, ComponentLogger, PeerId } from '@libp2p/interface'
import type { ConnectionManager, Registrar } from '@libp2p/interface-internal'
import type { Multiaddr } from '@multiformats/multiaddr'

Expand All @@ -62,7 +62,7 @@ export interface EchoComponents {

export interface Echo {
protocol: string
echo(peer: PeerId | Multiaddr | Multiaddr[], buf: Uint8Array): Promise<Uint8Array>
echo(peer: PeerId | Multiaddr | Multiaddr[], buf: Uint8Array, options?: AbortOptions): Promise<Uint8Array>
}

export function echo (init: EchoInit = {}): (components: EchoComponents) => Echo {
Expand Down

0 comments on commit 1bd2cc5

Please sign in to comment.