Decentralized DAB by NFID Labs

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:

  1. What’s the most reliable method to fetch all SNS tokens?
    We’ve found two endpoints, but neither solves the issue completely:
  1. 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);
}
6 Likes
  1. With the first step, you’re halfway there. https://sns-api.internetcomputer.org/api/v1/snses returns the root canisters of each SNS, and if you then query https://sns-api.internetcomputer.org/api/v1/snses/<root_canister_id>, you’ll get information about the canisters of that particular SNS, e.g., for the first one in the list BOOM DAO, https://sns-api.internetcomputer.org/api/v1/snses/xjngq-yaaaa-aaaaq-aabha-cai . Then look for ledger_canister_id (and potentially index_canister_id).
  2. This is not currently possible. We’re looking into options for this.
1 Like

You can get the list of SNSes (and canister IDs and a lot more) from a paginated list on the SNS aggregator.
The first page is here: https://3r4gx-wqaaa-aaaaq-aaaia-cai.icp0.io/v1/sns/list/page/0/slow.json
There are currently 4 pages.

1 Like

do we already have ideas how to provide this?