github.com/kisexp/xdchain@v0.0.0-20211206025815-490d6b732aa7/cmd/clef/intapi_changelog.md (about)

     1  ## Changelog for internal API (ui-api)
     2  
     3  The API uses [semantic versioning](https://semver.org/).
     4  
     5  TL;DR: Given a version number MAJOR.MINOR.PATCH, increment the:
     6  
     7  * MAJOR version when you make incompatible API changes,
     8  * MINOR version when you add functionality in a backwards-compatible manner, and
     9  * PATCH version when you make backwards-compatible bug fixes.
    10  
    11  Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
    12  
    13  ### 7.0.1 
    14  
    15  Added `clef_New` to the internal API callable from a UI.
    16  
    17  > `New` creates a new password protected Account. The private key is protected with
    18  > the given password. Users are responsible to backup the private key that is stored
    19  > in the keystore location that was specified when this API was created.
    20  > This method is the same as New on the external API, the difference being that
    21  > this implementation does not ask for confirmation, since it's initiated by
    22  > the user
    23  
    24  ### 7.0.0
    25  
    26  - The `message` field was renamed to `messages` in all data signing request methods to better reflect that it's a list, not a value.
    27  - The `storage.Put` and `storage.Get` methods in the rule execution engine were lower-cased to `storage.put` and `storage.get` to be consistent with JavaScript call conventions.
    28  
    29  ### 6.0.0
    30  
    31  Removed `password` from responses to operations which require them. This is for two reasons,
    32  
    33  - Consistency between how rulesets operate and how manual processing works. A rule can `Approve` but require the actual password to be stored in the clef storage.
    34  With this change, the same stored password can be used even if rulesets are not enabled, but storage is.
    35  - It also removes the usability-shortcut that a UI might otherwise want to implement; remembering passwords. Since we now will not require the
    36  password on every `Approve`, there's no need for the UI to cache it locally.
    37    - In a future update, we'll likely add `clef_storePassword` to the internal API, so the user can store it via his UI (currently only CLI works).
    38  
    39  Affected datatypes:
    40  - `SignTxResponse`
    41  - `SignDataResponse`
    42  - `NewAccountResponse`
    43  
    44  If `clef` requires a password, the `OnInputRequired` will be used to collect it.
    45  
    46  
    47  ### 5.0.0
    48  
    49  Changed the namespace format to adhere to the legacy ethereum format: `name_methodName`. Changes:
    50  
    51  * `ApproveTx` -> `ui_approveTx`
    52  * `ApproveSignData` -> `ui_approveSignData`
    53  * `ApproveExport` -> `removed`
    54  * `ApproveImport`  -> `removed`
    55  * `ApproveListing`  -> `ui_approveListing`
    56  * `ApproveNewAccount`  -> `ui_approveNewAccount`
    57  * `ShowError` -> `ui_showError`
    58  * `ShowInfo` -> `ui_showInfo`
    59  * `OnApprovedTx` -> `ui_onApprovedTx`
    60  * `OnSignerStartup` -> `ui_onSignerStartup`
    61  * `OnInputRequired` -> `ui_onInputRequired`
    62  
    63  
    64  ### 4.0.0
    65  
    66  * Bidirectional communication implemented, so the UI can query `clef` via the stdin/stdout RPC channel. Methods implemented are:
    67    - `clef_listWallets`
    68    - `clef_listAccounts`
    69    - `clef_listWallets`
    70    - `clef_deriveAccount`
    71    - `clef_importRawKey`
    72    - `clef_openWallet`
    73    - `clef_chainId`
    74    - `clef_setChainId`
    75    - `clef_export`
    76    - `clef_import`
    77  
    78  * The type `Account` was modified (the json-field `type` was removed), to consist of
    79  
    80  ```go
    81  type Account struct {
    82  	Address common.Address `json:"address"` // Ethereum account address derived from the key
    83  	URL     URL            `json:"url"`     // Optional resource locator within a backend
    84  }
    85  ```
    86  
    87  
    88  ### 3.2.0
    89  
    90  * Make `ShowError`, `OnApprovedTx`, `OnSignerStartup` be json-rpc [notifications](https://www.jsonrpc.org/specification#notification):
    91  
    92  > A Notification is a Request object without an "id" member. A Request object that is a Notification signifies the Client's lack of interest in the corresponding Response object, and as such no Response object needs to be returned to the client. The Server MUST NOT reply to a Notification, including those that are within a batch request.
    93  >
    94  >  Notifications are not confirmable by definition, since they do not have a Response object to be returned. As such, the Client would not be aware of any errors (like e.g. "Invalid params","Internal error"
    95  ### 3.1.0
    96  
    97  * Add `ContentType` `string` to `SignDataRequest` to accommodate the latest EIP-191 and EIP-712 implementations.
    98  
    99  ### 3.0.0
   100  
   101  * Make use of `OnInputRequired(info UserInputRequest)` for obtaining master password during startup
   102  
   103  ### 2.1.0
   104  
   105  * Add `OnInputRequired(info UserInputRequest)` to internal API. This method is used when Clef needs user input, e.g. passwords.
   106  
   107  The following structures are used:
   108  
   109  ```go
   110  UserInputRequest struct {
   111  	Prompt     string `json:"prompt"`
   112  	Title      string `json:"title"`
   113  	IsPassword bool   `json:"isPassword"`
   114  }
   115  UserInputResponse struct {
   116  	Text string `json:"text"`
   117  }
   118  ```
   119  
   120  ### 2.0.0
   121  
   122  * Modify how `call_info` on a transaction is conveyed. New format:
   123  
   124  ```
   125  {
   126    "jsonrpc": "2.0",
   127    "id": 2,
   128    "method": "ApproveTx",
   129    "params": [
   130      {
   131        "transaction": {
   132          "from": "0x82A2A876D39022B3019932D30Cd9c97ad5616813",
   133          "to": "0x07a565b7ed7d7a678680a4c162885bedbb695fe0",
   134          "gas": "0x333",
   135          "gasPrice": "0x123",
   136          "value": "0x10",
   137          "nonce": "0x0",
   138          "data": "0x4401a6e40000000000000000000000000000000000000000000000000000000000000012",
   139          "input": null
   140        },
   141        "call_info": [
   142          {
   143            "type": "WARNING",
   144            "message": "Invalid checksum on to-address"
   145          },
   146          {
   147            "type": "WARNING",
   148            "message": "Tx contains data, but provided ABI signature could not be matched: Did not match: test (0 matches)"
   149          }
   150        ],
   151        "meta": {
   152          "remote": "127.0.0.1:54286",
   153          "local": "localhost:8550",
   154          "scheme": "HTTP/1.1"
   155        }
   156      }
   157    ]
   158  }
   159  ```
   160  
   161  #### 1.2.0
   162  
   163  * Add `OnStartup` method, to provide the UI with information about what API version
   164  the signer uses (both internal and external) as well as build-info and external api.
   165  
   166  Example call:
   167  ```json
   168  {
   169    "jsonrpc": "2.0",
   170    "id": 1,
   171    "method": "OnSignerStartup",
   172    "params": [
   173      {
   174        "info": {
   175          "extapi_http": "http://localhost:8550",
   176          "extapi_ipc": null,
   177          "extapi_version": "2.0.0",
   178          "intapi_version": "1.2.0"
   179        }
   180      }
   181    ]
   182  }
   183  ```
   184  
   185  #### 1.1.0
   186  
   187  * Add `OnApproved` method
   188  
   189  #### 1.0.0
   190  
   191  Initial release.