How can I reliably fetch and update the logos of all SNS tokens?
https://sns-api.internetcomputer.org/api/v1/snses/3e3x2-xyaaa-aaaaq-aaalq-cai
This one is for OpenChat you should be able to fetch all of them from this api just replace the cansiter with root casniter or fetch from https://sns-api.internetcomputer.org/api/v1/snses and parse the json properly
Not sure what you mean by “update the logos,” but to retrieve all the data of the SNS you can use the SNS aggregator:
https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/
It provides the SNS project logos and the one of the token as well (in the icrc1_metadata field). However, I’m not sure if this logo is always be up to date, so it’s usually more reliable to perform an extra call to the respective ledger (you can find its ID in the canister_ids field, for example).
For example, the following script in OISY - which gathers the information and saves it in local data - essentially does this:
https://github.com/dfinity/oisy-wallet/blob/main/scripts/build.tokens.sns.ts
Any reason why you wouldn’t want to use
https://sns-api.internetcomputer.org/api/v1/snses/3e3x2-xyaaa-aaaaq-aaalq-cai
over the https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/ Canister?
The SNS aggregator is decentralized, governed by the NNS, and provides certified data.
Could this agregator be extended to also index. or save all the proposals? like discussed in the other topic of garbage collection so all proposals are saved on chain?
Cannot really answer. I don’t know. I would guess not as this sounds outside the scope of this SNS metadata aggregator but, not my call and again, I don’t know.
