@@ -36,34 +36,6 @@ export type Contact = {
3636 grantedAccess : GrantedAccess ;
3737} ;
3838
39- type SendTelegramCommonParams = {
40- senderName ?: string ;
41- telegramContent : string ;
42- label ?: string ;
43- workerpoolAddressOrEns ?: AddressOrENS ;
44- dataMaxPrice ?: number ;
45- appMaxPrice ?: number ;
46- workerpoolMaxPrice ?: number ;
47- useVoucher ?: boolean ;
48- } ;
49-
50- export type SendTelegramParams =
51- | ( {
52- /**
53- * protected data to process.
54- */
55- protectedData : Address ;
56- } & SendTelegramCommonParams )
57- | ( {
58- /**
59- * Granted access to process in bulk.
60- * use `fetchMyContacts({ bulkOnly: true })` to get granted accesses.
61- * if not provided, the single message will be processed.
62- */
63- grantedAccess : GrantedAccess [ ] ;
64- maxProtectedDataPerTask ?: number ;
65- } & SendTelegramCommonParams ) ;
66-
6739export type FetchMyContactsParams = {
6840 /**
6941 * Get contacts for this specific user only
@@ -79,27 +51,22 @@ export type FetchUserContactsParams = {
7951 userAddress : Address ;
8052} & FetchMyContactsParams ;
8153
82- type SendTelegramSingleResponse = {
83- taskId : string ;
54+ export type SendTelegramParams = {
55+ senderName ?: string ;
56+ telegramContent : string ;
57+ protectedData : Address ;
58+ label ?: string ;
59+ workerpoolAddressOrEns ?: AddressOrENS ;
60+ dataMaxPrice ?: number ;
61+ appMaxPrice ?: number ;
62+ workerpoolMaxPrice ?: number ;
63+ useVoucher ?: boolean ;
8464} ;
8565
86- type SendTelegramBulkResponse = {
87- tasks : {
88- bulkIndex : number ;
89- taskId : string ;
90- dealId : string ;
91- } [ ] ;
66+ export type SendTelegramResponse = {
67+ taskId : string ;
9268} ;
9369
94- export type SendTelegramResponse < Params = { protectedData : Address } > =
95- Params extends {
96- grantedAccess : GrantedAccess [ ] ;
97- }
98- ? SendTelegramBulkResponse
99- : never & Params extends { protectedData : Address }
100- ? SendTelegramSingleResponse
101- : never ;
102-
10370export type PrepareTelegramCampaignParams = {
10471 /**
10572 * Granted access to process in bulk.
@@ -121,6 +88,11 @@ export type PrepareTelegramCampaignResponse = {
12188 campaignRequest : BulkRequest ;
12289} ;
12390
91+ export type SendTelegramCampaignParams = {
92+ campaignRequest : BulkRequest ;
93+ workerpoolAddressOrEns ?: string ;
94+ } ;
95+
12496export type SendTelegramCampaignResponse = {
12597 tasks : {
12698 bulkIndex : number ;
@@ -129,11 +101,6 @@ export type SendTelegramCampaignResponse = {
129101 } [ ] ;
130102} ;
131103
132- export type SendTelegramCampaignParams = {
133- campaignRequest : BulkRequest ;
134- workerpoolAddressOrEns ?: string ;
135- } ;
136-
137104/**
138105 * Configuration options for web3telegram.
139106 */
0 commit comments