44 addressOrEnsSchema ,
55 throwIfMissing ,
66 campaignRequestSchema ,
7+ booleanSchema ,
78} from '../utils/validators.js' ;
89import { DataProtectorConsumer } from './internalTypes.js' ;
910import {
@@ -23,6 +24,7 @@ export const sendTelegramCampaign = async ({
2324 dataProtector = throwIfMissing ( ) ,
2425 workerpoolAddressOrEns = throwIfMissing ( ) ,
2526 campaignRequest,
27+ allowDeposit = false ,
2628} : DataProtectorConsumer &
2729 SendTelegramCampaignParams ) : Promise < SendTelegramCampaignResponse > => {
2830 try {
@@ -36,6 +38,10 @@ export const sendTelegramCampaign = async ({
3638 . label ( 'WorkerpoolAddressOrEns' )
3739 . validateSync ( workerpoolAddressOrEns ) ;
3840
41+ const vAllowDeposit = booleanSchema ( )
42+ . label ( 'allowDeposit' )
43+ . validateSync ( allowDeposit ) ;
44+
3945 if (
4046 vCampaignRequest . workerpool !== NULL_ADDRESS &&
4147 vCampaignRequest . workerpool . toLowerCase ( ) !==
@@ -47,10 +53,14 @@ export const sendTelegramCampaign = async ({
4753 }
4854
4955 // Process bulk request
56+ // TODO: Remove @ts -ignore once @iexec/dataprotector is updated to a version that includes allowDeposit in ProcessBulkRequestParams types
57+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
58+ // @ts -ignore - allowDeposit is supported at runtime but not yet in TypeScript types
5059 const processBulkRequestResponse : ProcessBulkRequestResponse < ProcessBulkRequestParams > =
5160 await dataProtector . processBulkRequest ( {
5261 bulkRequest : vCampaignRequest ,
5362 workerpool : vWorkerpoolAddressOrEns ,
63+ allowDeposit : vAllowDeposit ,
5464 } ) ;
5565
5666 return processBulkRequestResponse ;
0 commit comments