Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getAssetById return metadataHash nil #30

Open
LucaInfante opened this issue Apr 10, 2022 · 2 comments · May be fixed by #34
Open

getAssetById return metadataHash nil #30

LucaInfante opened this issue Apr 10, 2022 · 2 comments · May be fixed by #34

Comments

@LucaInfante
Copy link

When I try to retrieve an asset with getAssetById I obtain always metadataHash to nil.

If I try with PureStake the metadataHash is populated. Can you help me?

@stefanomondino
Copy link
Contributor

Ciao @LucaInfante (nice to meet you - I know your brother :D),

I'd love to doublecheck with @Jesulonimi21 on this.

At the moment, according to docs, we should expect this payload:

https://developer.algorand.org/docs/rest-apis/algod/v2/#assetparams

where metadataHash is optional.

I see two problems here -> https://github.com/Jesulonimi21/Swift-Algorand-Sdk/blob/main/Sources/swift-algorand-sdk/model/AssetParamsData.swift

  1. metadataHash is not mapped in CodingKeys
  2. metadataHash is defined as [UInt8], but it's returned as an hash string - it will never work.

We should add a custom decoding/encoding part like we did for other entities.

@LucaInfante is there any chance you could provide us an example JSON (with no sensitive data) we could use in unit tests so that we are sure we are not introducing regressions?

I've tried this

curl --location --request GET 'https://testnet-algorand.api.purestake.io:443/ps2/v2/assets/86247232' \
--header 'X-API-Key: ADRySlL0NK5trzqZGAE3q1xxIqlQdSfk1nbHxTNe'

from @Jesulonimi21 example but there's no metadataHash involved

Thanks!

stefanomondino added a commit to stefanomondino/Swift-Algorand-Sdk that referenced this issue May 8, 2022
… quicker conversions between Base64 strings and [Int8] arrays
@stefanomondino stefanomondino linked a pull request May 8, 2022 that will close this issue
@stefanomondino
Copy link
Contributor

@LucaInfante can you try linked PR (#34) and see if it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant