ERC725Alliance / erc725.js

Package to interact with ERC725 smart contracts
Apache License 2.0
38 stars 29 forks source link

If `getData`, `fetchData` or any `encode/decode` function is called with a string key return the result and not date key object. #126

Closed Hugoo closed 2 years ago

Hugoo commented 2 years ago

Similar to: https://github.com/ERC725Alliance/erc725.js/issues/119

frozeman commented 2 years ago

Also valid for other functions like getData, fetchData or any encode/decode

Hugoo commented 2 years ago

fetchData

It has been solved in this ticket: https://github.com/ERC725Alliance/erc725.js/issues/119

and the function is described in the docs: https://docs.lukso.tech/tools/erc725js/classes/ERC725#fetchdata

getData

The function was already implemented, as described in the docs: https://docs.lukso.tech/tools/erc725js/classes/ERC725#getdata

and it can be checked with this test: https://github.com/ERC725Alliance/erc725.js/blob/develop/src/index.test.ts#L167

L167 to L171

encodeData / decodeData

These functions take an object - not a string or an array or string. Is it relevant in that context? If so, can you add a few example inputs/outputs?

encodePermissions

Works with an object, I don't think it falls into this ticket.

encodeKeyName

Currently only work with one string as an input. This function can be improved to also add an array of string as an input, which would then output an array of strings in the same order.

Example:

ERC725.encodeKeyName('LSP3Profile');
// '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5'
ERC725.encodeKeyName('SupportedStandards:ERC725Account');
// '0xeafec4d89fa9619884b6b89135626455000000000000000000000000afdeb5d6'

// Feature to add:
ERC725.encodeKeyName(['LSP3Profile', 'SupportedStandards:ERC725Account']);
// ['0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5', '0xeafec4d89fa9619884b6b89135626455000000000000000000000000afdeb5d6']

I think we can close this ticket as features are already implemented. If not, can we make it more precise.

Hugoo commented 2 years ago

Cleared - the last part of this ticket has been described in this issue: https://github.com/ERC725Alliance/erc725.js/issues/140