diff --git a/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/addressesContainsAddress.ts b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/addressesContainsAddress.ts new file mode 100644 index 0000000000..033cd929c7 --- /dev/null +++ b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/addressesContainsAddress.ts @@ -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) +} diff --git a/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/index.ts b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/index.ts index 818d460193..270d5b9cd4 100644 --- a/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/index.ts +++ b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/index.ts @@ -1,2 +1,3 @@ +export * from './addressesContainsAddress.ts' export * from './addressesContainsAll.ts' export * from './addressesContainsAny.ts'