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

feat: add crossbell resolver #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Atlasoin
Copy link

No description provided.

@bonustrack
Copy link
Contributor

@AtlasQuan Thanks for the PR! I wasn't aware about Crossbell, do you know what is the coverage, or how many addresses have their avatar set on Crossbell?

@Atlasoin
Copy link
Author

Hi, Crossbell hasn't been launched for a long time. Each character is an NFT, so the token holder count in the scan is exactly the number of addresses: https://scan.crossbell.io/token/0xa6f969045641Cf486a747A2688F3a5A6d43cd0D8/token-holders. As you can see, currently there are 31034 addresses :P
image

@bonustrack
Copy link
Contributor

@AtlasQuan Ok interesting, so Crossbell is also a chain, do you know how many of these 31k addresses have activity in mainnet? When adding a new resolver we need to make sure there is enough coverage, cuz it will increase loading time of the avatar on first load.

@Atlasoin
Copy link
Author

Atlasoin commented Sep 28, 2022

I just wrote a script to calculate how many Crossbell users are active (having at least 1 transaction) on mainnet. The result is 25149 out of 31034. Plus, Crossbell is still at a very early dev stage, meaning there might be more users joining in this ecosystem in the future. Let me know what you think.

The snippet is below.

import ethers from "ethers";

const provider = new ethers.providers.WebSocketProvider(/* ws uri */);

const fetchAddresses = async (
	pageToken = "/token/0xa6f969045641cf486a747a2688f3a5a6d43cd0d8/token-holders?"
) => {
	return fetch(`https://scan.crossbell.io/${pageToken}&type=JSON`)
		.then((res) => res.json())
		.then((res) => {
			res.items = res.items.map((item) => item.match(/0x\w{40}/)[0]);
			return res;
		});
};

let result = 0;
let pageToken;
const main = async () => {
	while (true) {
		const { items, next_page_path } = await fetchAddresses(pageToken);

		await Promise.all(
			items.map(async (address) => {
				const count = await provider.getTransactionCount(address);

				console.log({ count });
				if (count > 0) {
					result++;
				}
			})
		);

		console.log({ result, next_page_path });

		if (!next_page_path) {
			break;
		}

		pageToken = next_page_path;
	}

	console.log({ result });
};

main();

image

@DIYgod
Copy link

DIYgod commented Feb 13, 2023

Hi, is there any progress on this pr? We are using stamp on RSS3, but have been missing this resolver that we want.

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 this pull request may close these issues.

3 participants