@@ -5,6 +5,11 @@ import { GraphQLClient } from 'graphql-request';
55import { fetchUserContacts } from './fetchUserContacts.js' ;
66import { fetchMyContacts } from './fetchMyContacts.js' ;
77import { sendTelegram } from './sendTelegram.js' ;
8+ import {
9+ sendTelegramCampaign ,
10+ SendTelegramCampaignParams ,
11+ SendTelegramCampaignResponse ,
12+ } from './sendTelegramCampaign.js' ;
813import {
914 Contact ,
1015 FetchUserContactsParams ,
@@ -115,23 +120,35 @@ export class IExecWeb3telegram {
115120 } ) ;
116121 }
117122
118- async sendTelegram < Params extends SendTelegramParams > (
119- args : Params
120- ) : Promise < SendTelegramResponse < Params > > {
123+ async sendTelegram (
124+ args : SendTelegramParams & { protectedData : string }
125+ ) : Promise < SendTelegramResponse > {
121126 await this . init ( ) ;
122127 await isValidProvider ( this . iexec ) ;
123128 return sendTelegram ( {
124129 ...args ,
125130 workerpoolAddressOrEns :
126131 args . workerpoolAddressOrEns || this . defaultWorkerpool ,
127132 iexec : this . iexec ,
128- dataProtector : this . dataProtector ,
129133 ipfsNode : this . ipfsNode ,
130134 ipfsGateway : this . ipfsGateway ,
131135 dappAddressOrENS : this . dappAddressOrENS ,
132136 dappWhitelistAddress : this . dappWhitelistAddress ,
133137 graphQLClient : this . graphQLClient ,
134- } as any ) as Promise < SendTelegramResponse < Params > > ;
138+ } ) ;
139+ }
140+
141+ async sendTelegramCampaign (
142+ args : SendTelegramCampaignParams
143+ ) : Promise < SendTelegramCampaignResponse > {
144+ await this . init ( ) ;
145+ await isValidProvider ( this . iexec ) ;
146+ return sendTelegramCampaign ( {
147+ ...args ,
148+ workerpoolAddressOrEns :
149+ args . workerpoolAddressOrEns || this . defaultWorkerpool ,
150+ dataProtector : this . dataProtector ,
151+ } ) ;
135152 }
136153
137154 async prepareTelegramCampaign (
0 commit comments