Skip to content

Commit

Permalink
Add addressesContainsAddress helper
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelBCarter committed Sep 24, 2024
1 parent eab65ce commit 036d15c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Address } from '@xylabs/hex'
import type { BoundWitness } from '@xyo-network/boundwitness-model'

/**
* Checks if the boundwitness contains the addresses
* @param bw The boundwitness to check
* @param addresses The address to check for
* @returns True if the boundwitness contains the addresses
*/
export const addressesContainsAddress = (bw: BoundWitness, address: Address): boolean => {
return bw.addresses?.includes(address)
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './addressesContainsAddress.ts'
export * from './addressesContainsAll.ts'
export * from './addressesContainsAny.ts'

0 comments on commit 036d15c

Please sign in to comment.