# ECommerceInterface

You use the ECommerce set of classes when you want to deal with the underlying EC APIs. With EC, you handle things such as [title management](https://docs.oscwii.org/wii-shop-channel/js/ec/title-objects) and [payment information](https://docs.oscwii.org/wii-shop-channel/js/ec/payment-objects). And you also have the option to handle components such as [device information](https://docs.oscwii.org/wii-shop-channel/js/ec/ecdeviceinfo), permitting identification of the console in several ways.

For every page, you'll want to initialize the `ECommerceInterface` type.

```javascript
var ec = new ECommerceInterface();
```

This special type inherits from `ECGenericObject`, an internal C++ type that many others use as a parent. You should only create this specific object type once per page load in JS, as it calls the special function `EC_Init` internally.

Inside of EC, there is a JS "[test mode](#js-test-mode-operations)" that allows modification of objects that are normally not modifiable via JS. It is not possible to enable it beyond binary patching, or editing memory.

## Members

| Member Name                                                                                                                                                                                                                             | Discussion                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ec.getVersion()`                                                                                                                                                                                                                       | Returns the EC library's version number. As of the Wii Shop Channel v21, this is `264192`, or `0x40800`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `ec.setParameter(name, value)`                                                                                                                                                                                                          | <p>Sets multiple internal EC library values.<br><br>Known names are:</p><ul><li><code>TIN</code>: a unique title number within games.</li><li><code>AppId</code>: the current running title ID.</li><li><code>PCPW</code>: Parental Control pin/password.</li><li><code>USE\_NCRS</code>: (unknown, accepts 0/1)</li><li><code>SPACE\_CHECK\_POLICY</code>:with a value of <code>SPACE\_CHECK\_USER\_ONLY</code> or <code>SPACE\_CHECK\_ENTIRE\_FS</code>.</li></ul><p>This calls <code>EC\_SetParameter</code> internally. The Wii Shop Channel does not set a TIN as many games might.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `ec.getSessionValue(name)`                                                                                                                                                                                                              | <p>For the current EC object, get a value for the given <code>name</code> from an internal store.<br><br>This key will persist within the internal store for the duration of the channel's runtime.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `ec.setSessionValue(name, value)`                                                                                                                                                                                                       | Sets the key for `name` to `value` within the internal store.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `ec.getPersistentValue(name)`                                                                                                                                                                                                           | Obtains a value by `name` from `ec.cfg`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `ec.setPersistentValue(name, value)`                                                                                                                                                                                                    | Sets a key by `name` to `value` in `ec.cfg`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `ec.getProgress()`                                                                                                                                                                                                                      | <p>Returns an <a href="ecprogress">ECProgress</a> object on the state of the given operation, or the most recent operation. <br><br>Returns -4007 if no operation is ongoing.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `ec.cancelOperation()`                                                                                                                                                                                                                  | Cancels the current operation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><code>ec.purchaseTitle(titleId, itemId, price, payment, limits, downloadContent, taxes, purchaseInfo, discount)</code><br><br><mark style="color:green;">🔒 Requires HTTPS</mark></p>                                                | <p>Formulates and sends a <code>PurchaseTitle</code> request, typically used with payment.<br><br>Parameters are as follows:</p><ul><li><code>titleId</code>: the title ID to purchase, as a string.</li><li><code>itemId</code>: Unknown.</li><li><code>price</code>: An instance of <a href="payment-objects/ecprice">ECPrice</a>.</li><li><code>payment</code>: Any instance of <a href="payment-objects/ececardpayment">ECECardPayment</a>, <a href="payment-objects/ecaccountpayment">ECAccountPayment</a>, or <a href="payment-objects/eccreditcardpayment">ECCreditCardPayment</a>/<a href="payment-objects/eccreditcardencryptedpayment">ECCreditCardEncryptedPayment</a>.</li><li><code>limits</code>: An instance of <a href="../title-objects/ectitlelimit#ectitlelimits">ECTitleLimits</a>. It's acceptable to have this be zero in length.</li><li><code>downloadContent</code>: A boolean on whether the title should be downloaded .</li><li><code>taxes</code> (optional): A string seemingly holding the price calculated for taxes. It's unclear on how this would be used.</li><li><code>purchaseInfo</code> (optional): Unknown string value.</li><li><code>discount</code> (optional): Unknown string value.</li></ul>                                                                                                                                                                                    |
| <p><code>ec.purchaseGiftTitle(titleId, itemId, price, payment, limits, identifier, identifierKind, notes, taxes, purchaseInfo)</code><br><br><mark style="color:green;">🔒 Requires HTTPS</mark></p>                                    | <p></p><p>Formulates and sends a <code>PurchaseTitle</code> request, typically used with payment.<br><br>Parameters are as follows:</p><ul><li><code>titleId</code>: the title ID to purchase, as a string.</li><li><code>itemId</code>: Unknown.</li><li><code>price</code>: An instance of <a href="payment-objects/ecprice">ECPrice</a>.</li><li><code>payment</code>: Any instance of <a href="payment-objects/ececardpayment">ECECardPayment</a>, <a href="payment-objects/ecaccountpayment">ECAccountPayment</a>, or <a href="payment-objects/eccreditcardpayment">ECCreditCardPayment</a>/<a href="payment-objects/eccreditcardencryptedpayment">ECCreditCardEncryptedPayment</a>.</li><li><code>limits</code>: An instance of <a href="../title-objects/ectitlelimit#ectitlelimits">ECTitleLimits</a>. It's acceptable to have this be zero in length.</li><li><code>identifier</code>: An identifying value for the recipient console, such as its Wii friend code.</li><li><code>identifierKind</code>: The type of identifying value.</li><li><code>notes</code> (optional): Potentially a note for the recipient, unknown.</li><li><code>taxes</code> (optional): A string seemingly holding the price calculated for taxes. It's unclear on how this would be used.</li><li><code>purchaseInfo</code> (optional): Unknown string value.</li><li><code>discount</code> (optional): Unknown string value.</li></ul> |
| <p><code>ec.acceptGiftTitle(titleId, transactionId, accept, reason, downloadContent)</code><br></p><p><mark style="color:green;">🔒 Requires HTTPS</mark></p>                                                                           | <p>Accepts, or rejects, a gifted title.</p><ul><li><code>titleId</code>: the title to accept.</li><li><code>transactionId</code>: The recipient's transaction ID, sent via query parameters in the sent Wii Mail.</li><li><code>accept</code>: Whether this gift was accepted (true) or rejected (false).</li><li><code>reason</code> (optional): Seemingly a string as to why. It's unclear on where this is sent.</li><li><code>downloadContent</code> (optional): Whether to download this title upon acceptance.</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><code>ec.unregister(challenge)</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                 | <p>Performs a request to unregister this console from the server. As part of <code>EC\_Unregister</code>, this may mean NAND titles and tickets are deleted.<br><br>The <code>challenge</code> parameter is typically obtained from issuing a call to <code>ec.sendChallengeReq()</code>, awaiting its completion, and utilizing the result from the server via <code>ec.getChallengeResp()</code>. However, the client does not enforce a challenge is ever called. It is safe to use any value desired.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>ec.deleteOwnership(titleId, ticketId)</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                    | Deletes the local copy of this ticket, and additionally registers with the server that a ticket has been deleted for the given `titleId` and `ticketId`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `ec.syncTickets(type)`                                                                                                                                                                                                                  | <p>Sends a list of local tickets on the console, and reads a list of tickets from the server<br><br>The parameter <code>type</code> is optional, and defaults to zero. It is unknown what other sync types are available.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `ec.checkDeviceStatus()`                                                                                                                                                                                                                | Synchronizes values such as ticket sync times and point balances.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `ec.refreshCachedBalance()`                                                                                                                                                                                                             | Requests the console's current points balance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `ec.getCachedBalance()`                                                                                                                                                                                                                 | Returns the current cached points balance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `ec.getPurchaseInfo()`                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ec.getTransactionInfos()`                                                                                                                                                                                                              | Retrieves transaction history from the server, returning an [ECTransactionInfos](https://docs.oscwii.org/wii-shop-channel/js/payment-objects/ectransactioninfo#ectransactioninfos) object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| <p><code>ec.purchasePoints()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ec.downloadTitle()`                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ec.checkFirmware()`                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>ec.generateKeyPair()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                     | Returns -4002 - possibly not implemented, or deprecated?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><code>ec.confirmKeyPair()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                      | Returns -4002 - possibly not implemented, or deprecated?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `ec.checkRegistration()`                                                                                                                                                                                                                | Makes a request via ECS for the `CheckRegistration` type.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><code>ec.register(challenge)</code><br><br><code>ec.register(challenge, extAccountId)</code><br><code>ec.register(challenge, extAccountId, extAccountPassword)</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p> | <p>Performs a request to register this console to the server.<br><br>It is possible to override sent credentials while registering, as during a re-register configured credentials from <code>ec.cfg</code> will be sent.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>ec.transfer()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                            |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>ec.syncRegistration()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                    | Syncs the registration state of this console, seemingly updating token, serial number, friend codes, and other values as appropriate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| <p><code>ec.sendChallengeReq()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                    | Requests a challenge from the configured IAS server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>ec.getChallengeResp()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                    | Retrieves the returned challenge from the given IAS server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| <p><code>ec.reportCSS()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>ec.confirmCSS()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ec.getCSSConfirmation()`                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `ec.getTitleInfo(titleId)`                                                                                                                                                                                                              | Returns an [ECTitleInfo](https://docs.oscwii.org/wii-shop-channel/js/ec/title-objects/ectitleinfo) for the specified title ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `ec.getTitleInfos()`                                                                                                                                                                                                                    | Returns an [ECTitleInfos](https://docs.oscwii.org/wii-shop-channel/js/ec/title-objects/ectitleinfo) for all available titles on the console.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `ec.getTicketInfos(titleId)`                                                                                                                                                                                                            | Returns an [ECTicketInfos](https://docs.oscwii.org/wii-shop-channel/js/title-objects/ecticketinfo#ecticketinfos) for the given title ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `ec.getDeviceInfo()`                                                                                                                                                                                                                    | Returns an object you can use to access information with. See its dedicated page, [ECDeviceInfo](https://docs.oscwii.org/wii-shop-channel/js/ec/ecdeviceinfo), for more information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>ec.setWebSvcUrls(ecs)</code><br><code>ec.setWebSvcUrls(ecs, ias)</code><br><code>ec.setWebSvcUrls(ecs, ias, cas)</code></p>                                                                                                    | <p>Sets endpoints for usage.</p><ul><li><code>ecs</code>: The ECommerceSOAP endpoint, utilized for requests related to titles and purchases.</li><li><code>ias</code>: The IdentityAuthenticationSOAP endpoint, utilized for identity and registration-related requests.</li><li><code>cas</code>: The CatalogingSOAP endpoint, utilized for listing available titles (such as for DLCs or service titles).</li></ul><p>CAS is not used within the Wii Shop Channel - only used in other ECDK-utilizing titles, such as for DLC content.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><code>ec.setContentUrls(ccs)</code><br><code>ec.setContentUrls(ccs, ucs)</code></p>                                                                                                                                                  | `ccs` appears to be an `http` URL by default, presumably meaning "cached contents". `ucs` may mean "uncached contents", using an `https` URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `ec.checkParentalControlPassword(pin)`                                                                                                                                                                                                  | Validates the given Parental Control PIN/password as a long. If this is disabled, it returns `-4075`, or `-0xfeb`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `ec.launchTitle(titleId, ticketId)`                                                                                                                                                                                                     | Launches the passed title with the given ticket.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `ec.request(requestString)`                                                                                                                                                                                                             | Requests something, with a callback. \*\*TODO\*\*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <p><code>ec.getWeakToken()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| <p><code>ec.startLog()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                            | Creates a new logging buffer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><code>ec.stopLog()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                             | Destroys the present logging buffer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><code>ec.getLog()</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p>                                                                                                                                              | Returns a string with the internal held log from buffer.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |

## JS Test Mode Operations

These following functions **do not function** without the JS test mode being enabled via binary patching. They will log such if called. Do not expect them to work.

| Member Name                                                                                                | Discussion                                                                                                                                                                                                                                                                                                                            |
| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ec.setLanguage(language)`                                                                                 | Overrides the configured language for this EC object.                                                                                                                                                                                                                                                                                 |
| `ec.setCountry(country)`                                                                                   | Overrides the configured country for this EC object.                                                                                                                                                                                                                                                                                  |
| `ec.setRegion(region)`                                                                                     | Overrides the configured region for this EC object.                                                                                                                                                                                                                                                                                   |
| `ec.setAge(age)`                                                                                           | Overrides the configured age for this EC object.                                                                                                                                                                                                                                                                                      |
| `ec.setAccountId(accountId, deviceToken)`                                                                  | <p>Overrides the configured account ID for this EC object.<br><br>If a constructor parameter is not specified as a string, it will default to the string literal <code>null</code>.</p>                                                                                                                                               |
| `ec.deleteTitleContent(titleId)`                                                                           | Deletes a title's contents from the console.                                                                                                                                                                                                                                                                                          |
| `ec.deleteTitle(titleId)`                                                                                  | Deletes a title's contents and data from the console.                                                                                                                                                                                                                                                                                 |
| `ec.deleteLocalTicket(titleId, ticketId)`                                                                  | Deletes a title's contents, data, and ticket from the console.                                                                                                                                                                                                                                                                        |
| `ec.pubKeyEncrypt(message)`                                                                                | Encrypts a message with the console's public key, returning a base64-encoded string of the encrypted contents.                                                                                                                                                                                                                        |
| `ec.runTests()`                                                                                            | Unknown. Appears to return zero.                                                                                                                                                                                                                                                                                                      |
| <p><code>ec.setOption(option, value)</code><br><br>🔒 <mark style="color:green;">Requires HTTPS</mark></p> | <p>Sets an option within EC.<br><br>Only two options are accepted:</p><ul><li><code>0</code>: Sets the JS test mode, where <code>value</code> is a boolean.</li><li><code>1</code>: Adjusts the log level is adjusted to that of <code>value</code>.</li></ul><p>All other options appear to return -4004, or <code>0xfa4</code>.</p> |
