We’ve built a v1 governable ICRC-1 token API that we’re already using in NFID Wallet, is being used by the Bity team in their wallet, and that we’d like to roll out for the whole ecosystem after a bit of additional polish.
There’s something wonky with our dfx metadata so for now you’ll have to access the get_all_icrc1_canisters endpoint for the zjahs-wyaaa-aaaal-qjuia-cai canister through the candid UI with the did pasted at the bottom (sorry, don’t have forum permission to post the file itself).
@nadiein and I have a couple of questions regarding token data retrieval:
- What’s the most reliable method to fetch all SNS tokens?
We’ve found two endpoints, but neither solves the issue completely:
- https://sns-api.internetcomputer.org/api/v1/snses
This one seems to return the correct list of tokens, but it’s missing the ledger canister ID and index canister ID, which are fundamental for token identification. - https://icrc-api.internetcomputer.org/api/v1/ledgers?token_types=sns
This provides the ledger canister ID, but not all SNS tokens, and it includes some SNS projects that hadn’t succeed through the swap (e.g., Juno Build).
- How can we determine if an ICRC-1 token has an index canister?
From the limited research we’ve done so far, there’s not yet a reliable answer.
Thanks, everyone!
did file for canister zjahs-wyaaa-aaaal-qjuia-cai:
type Category = variant {
Sns;
Known;
Spam;
ChainFusionTestnet;
ChainFusion;
Community;
Native;
};
type Conf = record {
controllers : opt vec principal;
im_canister : opt principal;
};
type ICRC1 = record {
logo : opt text;
name : text;
ledger : text;
category : Category;
index : opt text;
symbol : text;
decimals : nat8;
fee : nat;
};
type ICRC1Request = record {
logo : opt text;
name : text;
ledger : text;
index : opt text;
symbol : text;
decimals : nat8;
fee : nat;
};service : (opt Conf) -> {
get_all_icrc1_canisters : () -> (vec ICRC1) query;
replace_icrc1_canisters : (vec ICRC1) -> ();
store_new_icrc1_canisters : (vec ICRC1) -> ();
store_icrc1_canister : (ICRC1Request) -> ();
sync_controllers: () -> (vec text);
}