Closed frozeman closed 2 years ago
@frozeman If the input object has only one key:
const encodedDataManyKeys = asset.encodeData({
'LSP3IssuedAssets[]': [
'0xa3e6F38477D45727F6e6f853Cdb479b0D60c0aC9',
],
)
should the output be:
{
keys: [
'0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0',
'0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000000'
],
values: [
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0xa3e6f38477d45727f6e6f853cdb479b0d60c0ac9'
]
}
or:
{
'LSP3IssuedAssets[]':
{
keys: [
'0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0',
'0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000000'
],
values: [
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0xa3e6f38477d45727f6e6f853cdb479b0d60c0ac9'
]
}
}
i.e.: if the input object has only 1 key -> then the output object has no key and is the direct result. I think 2) is better in this case. Because here, the input is always an object.
const encodedDataManyKeys = asset.encodeData({
'LSP3IssuedAssets[]': [
'0xa3e6F38477D45727F6e6f853Cdb479b0D60c0aC9',
],
'LSP3Profile': {LSP3Profiel: .........}
)
results in
{
keys: [
'0x3a47ab5bd3a594c3a8995f8fa58d0876c96819ca4516bd76100c92462f2f9dc0',
'0x3a47ab5bd3a594c3a8995f8fa58d087600000000000000000000000000000000',
'0x5ef83ad9559033e6e941db7d7c495acdce616347d28e90c7ce47cbfcfcad3bc5'
],
values: [
'0x0000000000000000000000000000000000000000000000000000000000000001',
'0xa3e6f38477d45727f6e6f853cdb479b0d60c0ac9',
'0xf38477d45727f6e6f8f38477d45727f6e6f8f38477d45727f6e6f8a3e6f38477d45727f6e6f853cdb479b0d60c0ac9'
]
}
This issue is a duplicate of #140 - we will close this one and move the specs from this ticket to the issue #140
should result in all keys flattened into one single array, to be used for a transaction
but results in: