@iexec/web3mail 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +7 -7
  2. package/dist/config/config.d.ts +6 -1
  3. package/dist/config/config.js +21 -10
  4. package/dist/config/config.js.map +1 -1
  5. package/dist/utils/getChainId.js +7 -2
  6. package/dist/utils/getChainId.js.map +1 -1
  7. package/dist/utils/getWeb3Provider.d.ts +10 -2
  8. package/dist/utils/getWeb3Provider.js +12 -7
  9. package/dist/utils/getWeb3Provider.js.map +1 -1
  10. package/dist/utils/resolveDappAddressFromCompass.d.ts +2 -2
  11. package/dist/utils/validators.d.ts +0 -2
  12. package/dist/utils/validators.js +0 -4
  13. package/dist/utils/validators.js.map +1 -1
  14. package/dist/web3mail/IExecWeb3mail.d.ts +2 -2
  15. package/dist/web3mail/IExecWeb3mail.js +13 -14
  16. package/dist/web3mail/IExecWeb3mail.js.map +1 -1
  17. package/dist/web3mail/fetchMyContacts.d.ts +1 -1
  18. package/dist/web3mail/fetchMyContacts.js +2 -2
  19. package/dist/web3mail/fetchMyContacts.js.map +1 -1
  20. package/dist/web3mail/fetchUserContacts.d.ts +1 -1
  21. package/dist/web3mail/fetchUserContacts.js +20 -25
  22. package/dist/web3mail/fetchUserContacts.js.map +1 -1
  23. package/dist/web3mail/internalTypes.d.ts +2 -2
  24. package/dist/web3mail/prepareEmailCampaign.d.ts +1 -1
  25. package/dist/web3mail/prepareEmailCampaign.js +10 -10
  26. package/dist/web3mail/prepareEmailCampaign.js.map +1 -1
  27. package/dist/web3mail/sendEmail.d.ts +1 -1
  28. package/dist/web3mail/sendEmail.js +21 -41
  29. package/dist/web3mail/sendEmail.js.map +1 -1
  30. package/dist/web3mail/sendEmail.models.d.ts +8 -27
  31. package/dist/web3mail/sendEmail.models.js +5 -28
  32. package/dist/web3mail/sendEmail.models.js.map +1 -1
  33. package/dist/web3mail/sendEmailCampaign.d.ts +1 -1
  34. package/dist/web3mail/sendEmailCampaign.js +8 -9
  35. package/dist/web3mail/sendEmailCampaign.js.map +1 -1
  36. package/dist/web3mail/types.d.ts +8 -11
  37. package/package.json +4 -4
  38. package/src/config/config.ts +24 -12
  39. package/src/utils/getChainId.ts +11 -2
  40. package/src/utils/getWeb3Provider.ts +13 -6
  41. package/src/utils/resolveDappAddressFromCompass.ts +2 -2
  42. package/src/utils/validators.ts +0 -11
  43. package/src/web3mail/IExecWeb3mail.ts +20 -23
  44. package/src/web3mail/fetchMyContacts.ts +2 -2
  45. package/src/web3mail/fetchUserContacts.ts +21 -27
  46. package/src/web3mail/internalTypes.ts +2 -2
  47. package/src/web3mail/prepareEmailCampaign.ts +11 -11
  48. package/src/web3mail/sendEmail.models.ts +6 -68
  49. package/src/web3mail/sendEmail.ts +26 -58
  50. package/src/web3mail/sendEmailCampaign.ts +10 -11
  51. package/src/web3mail/types.ts +8 -13
@@ -1,12 +1,8 @@
1
- import { EnhancedWallet } from 'iexec';
1
+ import type { AbstractSigner } from 'ethers';
2
2
  import { IExecConfigOptions } from 'iexec/IExecConfig';
3
3
  import type { BulkRequest } from '@iexec/dataprotector';
4
4
 
5
- export type Web3SignerProvider = EnhancedWallet;
6
-
7
- export type ENS = string;
8
-
9
- export type AddressOrENS = Address | ENS;
5
+ export type Web3SignerProvider = AbstractSigner;
10
6
 
11
7
  export type Address = string;
12
8
 
@@ -59,11 +55,10 @@ export type SendEmailParams = {
59
55
  contentType?: string;
60
56
  senderName?: string;
61
57
  label?: string;
62
- workerpoolAddressOrEns?: AddressOrENS;
58
+ workerpoolAddress?: Address;
63
59
  dataMaxPrice?: number;
64
60
  appMaxPrice?: number;
65
61
  workerpoolMaxPrice?: number;
66
- useVoucher?: boolean;
67
62
  };
68
63
 
69
64
  export type FetchMyContactsParams = {
@@ -100,10 +95,10 @@ export type SendEmailResponse = {
100
95
  */
101
96
  export type Web3MailConfigOptions = {
102
97
  /**
103
- * The Ethereum contract address or ENS (Ethereum Name Service) for the email sender dapp.
98
+ * Ethereum contract address for the email sender dapp.
104
99
  * If not provided, the default web3mail address will be used.
105
100
  */
106
- dappAddressOrENS?: AddressOrENS;
101
+ dappAddress?: Address;
107
102
 
108
103
  /**
109
104
  * The Ethereum contract address for the whitelist.
@@ -156,7 +151,7 @@ export type PrepareEmailCampaignParams = {
156
151
  emailContent: string;
157
152
  contentType?: string;
158
153
  label?: string;
159
- workerpoolAddressOrEns?: AddressOrENS;
154
+ workerpoolAddress?: Address;
160
155
  dataMaxPrice?: number;
161
156
  appMaxPrice?: number;
162
157
  workerpoolMaxPrice?: number;
@@ -177,9 +172,9 @@ export type SendEmailCampaignParams = {
177
172
  */
178
173
  campaignRequest: CampaignRequest;
179
174
  /**
180
- * Workerpool address or ENS to use for processing
175
+ * Workerpool contract address used for processing
181
176
  */
182
- workerpoolAddressOrEns?: AddressOrENS;
177
+ workerpoolAddress?: string;
183
178
  };
184
179
 
185
180
  export type SendEmailCampaignResponse = {