You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ethapp.asc
+96Lines changed: 96 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,9 @@ Application version 1.5.0 - 25th of September 2020
23
23
## 1.7.6
24
24
- Add SET EXTERNAL PLUGIN
25
25
26
+
## 1.9.13
27
+
- Add SET PLUGIN
28
+
26
29
## About
27
30
28
31
This application describes the APDU messages interface to communicate with the Ethereum application.
@@ -240,6 +243,49 @@ signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f
240
243
241
244
None
242
245
246
+
### PROVIDE NFT INFORMATION
247
+
248
+
#### Description
249
+
250
+
This commands provides a trusted description of an NFT to associate a contract address with a collectionName.
251
+
252
+
It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper nft information to the user if necessary, as marked in GET APP CONFIGURATION flags.
253
+
254
+
The signature is computed on
255
+
256
+
type || version || len(collectionName) || collectionName || address || chainId || keyId || algorithmId || len(signature) || signature
@@ -283,6 +329,56 @@ signed by the following secp256k1 public key 0482bbf2f34f367b2e5bc21847b6566f21f
283
329
284
330
None
285
331
332
+
### SET PLUGIN
333
+
334
+
#### Description
335
+
336
+
This commands provides the name of a trusted binding of a plugin with a contract address and a supported method selector. This plugin will be called to interpret contract data in the following transaction signing command.
337
+
338
+
It can be used to set both internal and external plugins.
339
+
340
+
It shall be run immediately before performing a transaction involving a contract supported by this plugin to display the proper information to the user if necessary.
341
+
342
+
The function returns an error sw (0x6984) if the plugin requested is not installed on the device, 0x9000 otherwise.
343
+
344
+
The plugin names `ERC20`, `ERC721` and `ERC1155` are reserved. Additional plugin names might be added to this list in the future.
This message is sent when the data field has been fully parsed. The following specific fields can be filled by the plugin :
163
163
164
-
* tokenLookup1 : the pointer shall be set to a 20 bytes address to look up an ERC 20 token descriptor if needed by the plugin
165
-
* tokenLookup2 : the pointer shall be set to a 20 bytes address to look up an ERC 20 token descriptor if needed by the plugin
164
+
* itemLookup1 : the pointer shall be set to a 20 bytes address to look up an ERC20 token or NFT if needed by the plugin
165
+
* itemLookup2 : the pointer shall be set to a 20 bytes address to look up an ERC20 token or NFT if needed by the plugin
166
166
* uiType : set to either ETH_UI_TYPE_AMOUNT_ADDRESS for an amount/address UI or ETH_UI_TYPE_GENERIC for a generic UI
167
167
168
168
The following specific fields are filled by the plugin when returning an amount/address UI :
@@ -179,32 +179,32 @@ The following return codes are expected, any other will abort the signing proces
179
179
* ETH_PLUGIN_RESULT_OK : if the plugin can be successfully initialized
180
180
* ETH_PLUGIN_RESULT_FALLBACK : if the signing logic should fallback to the generic one
181
181
182
-
### ETH_PLUGIN_PROVIDE_TOKEN
182
+
### ETH_PLUGIN_PROVIDE_INFO
183
183
184
184
[source,C]
185
185
----
186
186
187
-
typedef struct ethPluginProvideToken_t {
187
+
typedef struct ethPluginProvideInfo_t {
188
188
189
189
ethPluginSharedRW_t *pluginSharedRW;
190
190
ethPluginSharedRO_t *pluginSharedRO;
191
191
uint8_t *pluginContext;
192
192
193
-
tokenDefinition_t *token1; // set by the ETH application, to be saved by the plugin
194
-
tokenDefinition_t *token2;
193
+
union extraInfo *item1; // set by the ETH application, to be saved by the plugin
194
+
union extraInfo *item2;
195
195
196
-
uint8_t additionalScreens; // Used by the plugin if it needs to display additional screens based on the information received from the token definitions.
196
+
uint8_t additionalScreens; // Used by the plugin if it needs to display additional screens based on the information received.
197
197
198
198
uint8_t result;
199
199
200
-
} ethPluginProvideToken_t;
200
+
} ethPluginProvideInfo_t;
201
201
202
202
----
203
203
204
-
This message is sent if a token lookup was required by the plugin when parsing a finalize message. The following specific fields are filled when the plugin is called :
204
+
This message is sent if an information lookup was required by the plugin when parsing a finalize message. The following specific fields are filled when the plugin is called :
205
205
206
-
* token1 : pointer to a token definition matching tokenLookup1, or NULL if not found
207
-
* token2 : pointer to a token definition matching tokenLookup2, or NULL if not found or not requested
206
+
* item1 : pointer to an union matching itemLookup1, or NULL if not found
207
+
* item2 : pointer to an union matching itemLookup2, or NULL if not found
208
208
209
209
The following return codes are expected, any other will abort the signing process :
This message is sent after the parsing finalization and token lookups if requested if a generic UI is used. The following specific fields are provided when the plugin is called :
236
+
This message is sent after the parsing finalization and information lookups if requested if a generic UI is used. The following specific fields are provided when the plugin is called :
237
237
238
238
* name : pointer to the name of the plugin, to be filled by the plugin
This message is sent when a plugin screen shall be displayed if a generic UI is used. The following specific fields are provided when the plugin is called :
270
273
274
+
275
+
* item1 : pointer to token / nft information
276
+
* item2 : pointer to token / nft information
277
+
* network_ticker : string that holds the network ticker
271
278
* screenIndex : index of the screen to display, starting from 0
272
279
* title : pointer to the first line of the screen, to be filled by the plugin
0 commit comments