v0.14.0
github-actions
released this
14 Jun 18:52
·
454 commits
to develop
since this release
This release brings a lot of breaking changes and new features.
⚠️ Breaking changes
Use array instead of object
The parameters of decodeData
, encodeData
, getData
and fetchData
have been unified to always use the same array of objects:
[
{
name: 'LSP3Profile',
key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
value: {
hashFunction: 'keccak256(utf8)',
hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
},
]
The output/input are not an object anymore. The key of the previous object is now set under the keyName
property.
❌ Before:
{
LSP3Profile: {
hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
hashFunction: 'keccak256(utf8)',
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
}
✅ After:
[
{
name: 'LSP3Profile',
key: '0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5',
value: {
hashFunction: 'keccak256(utf8)',
hash: '0x820464ddfac1bec070cc14a8daf04129871d458f2ca94368aae8391311af6361',
url: 'ipfs://QmYr1VJLwerg6pEoscdhVGugo39pa6rycEZLjtRPDfW84UAx',
},
},
]
Support of dynamic keys
All the functions now supports dynamic keys (Mapping
and MappingWithGrouping
). They can be used with the dynamicKeyParts
property:
erc725.encodeData([
{
keyName: 'DynamicKey:<address>',
dynamicKeyParts: ['0xbedbedbedbedbedbedbedbedbedbedbedbedbedb'],
value: '0xcafecafecafecafecafecafecafecafecafecafe',
},
]);
⚠ BREAKING CHANGES
- fetchData as same output as decodeData
- getData as same output as decodeData
- add dynamic keys for getData
- use array for decodeData
- use array for encodeData
Features
- add dynamic keys for getData (7a46786)
- add dynamicKeys for decodeData (f386e15)
- add non array input on decodeData (0774a86)
- add support for hashed key for encodeData (23323a0)
- add BytesN value content (#184) (7e073e4)
- add tuples support (7f3d1a0)
Bug Fixes
- encodeKeyName returns lowercase keys (80566eb)