You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,9 @@ The library is designed to be compatible with both module systems, so you can ch
145
145
-`getEndpoint(network?: number | string, countriesList?: string | Array<string>): { [key: string]: Array<string> }` — Get an object of SMS endpoints (phone numbers) per country.
146
146
-`sms(number?: boolean | string | number | Array<string>, message?: string, network?: number | string, encodeMessage?: boolean, platform?: string): string` — Create an SMS URI based on the provided parameters.
147
147
-`mms(number?: boolean | string | number | Array<string>, message?: string, network?: number | string, encodeMessage?: boolean, platform?: string): string` — Create an MMS URI based on the provided parameters.
148
-
-`downloadMessage(hex: string, optionalFilename?: string): Promise<string>` — Download a file with the encoded content as `.txms.txt` file in your working directory.
148
+
-`downloadMessage(hex: string | string[], optionalFilename?: string): Promise<string>` — Download a file with the encoded content as `.txms.txt` file in your working directory. You can provide one hex transaction or an array of transactions (`.batch` will be prepended to suffix if batch is chosen and optional name not defined).
149
+
150
+
Note: The `downloadMessage` function is asynchronous and returns a Promise. You can use the `await` keyword to wait for the Promise to resolve. The function will download a file with the encoded content as a `(.batch).txms.txt` file in your working directory. You can optionally provide a filename as the second parameter. It is designed to be used in Node.js environments as well as Browser. It is not designed to download high amount of files. if you prefer to do your own download flow, you can use the `encode` function and save the result to a file.
149
151
150
152
### Parameters
151
153
@@ -157,6 +159,7 @@ The library is designed to be compatible with both module systems, so you can ch
157
159
-`message` = the SMS message content.
158
160
-`encodeMessage` (default: `true`) = whether to encode the message before using `encodeURIComponent`.
159
161
-`platform` = the platform to use for the SMS URI. Currently supported: `ios`, `global`. Default: `global`. `ios` uses the `&body=`, while `global` uses the `?` for `?body=` parameter.
162
+
-`optionalFilename` = the optional filename for the downloaded file suffixed with `.txms.txt`. Filename is slugified.
@@ -276,7 +279,7 @@ One MMS has 1600 characters. The MMS text limit is 5000 characters. MMS object h
276
279
277
280
To send MMS, you can use two options:
278
281
279
-
- You can place the content as text document with extension `.txms` and send it to the same number. Each transaction can be divided with new line. You can place multiple `txms` files in one MMS.
282
+
- You can place the content as text document (text/plain) with extension `.txms.txt` and send it to the same number. Each transaction can be divided with new line. You can place multiple `txms` files into one MMS.
280
283
- Place transaction(s) in the text message body and send it to the same number. Each transaction can be divided with new line.
281
284
282
285
MMS has about the same price as SMS (in Slovakia), but the downside is that smartphone should have enabled the MMS service and the data are stored on 3rd party server.
@@ -290,19 +293,19 @@ You're welcome to contribute in any capacity.
- Opening a [pull request](https://github.com/bchainhub/txms.js/pulls)
294
298
- Creating your own [SMS endpoint](#sms-endpoint)
295
299
- Sending us some Øres / ₡ores: [cb7147879011ea207df5b35a24ca6f0859dcfb145999](https://blockindex.net/address/cb7147879011ea207df5b35a24ca6f0859dcfb145999)
296
-
- Starring this repository
297
300
298
-
To contribute, please follow the steps:
301
+
### To Contribute, Please Follow These Steps
299
302
300
-
1. Fork the repository.
303
+
1.[Fork the repository](https://github.com/bchainhub/txms.js/fork).
301
304
2. Create a new branch.
302
305
3. Make your changes.
303
306
4. Commit your changes.
304
307
5. Push your changes.
305
-
6. Open a pull request.
308
+
6.[Open a pull request](https://github.com/bchainhub/txms.js/pulls).
306
309
307
310
Please ensure your code is well-documented and follows the project's coding standards.
0 commit comments