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: switch to dedicated backend for identicons #43

Merged
merged 4 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 19.4.0
- uses: pnpm/action-setup@v2.2.2
- uses: pnpm/action-setup@v4
with:
version: 7.1.7
version: 8.15.3
- name: Install dependencies
run: pnpm install --strict-peer-dependencies=false --no-frozen-lockfile
- name: Print project structure
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starknetid.js",
"version": "4.0.0",
"version": "4.0.1",
"description": "JavaScript library for Starknet ID",
"private": false,
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/__test__/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe("test starknetid.js sdk", () => {
github: undefined,
discord: "123",
proofOfPersonhood: false,
profilePicture: "https://starknet.id/api/identicons/1",
profilePicture: "https://identicon.starknet.id/1",
};
expect(profile).toStrictEqual(expectedProfile);
});
Expand Down Expand Up @@ -429,11 +429,11 @@ describe("test starknetid.js sdk", () => {
},
{
name: "test.stark",
profilePicture: "https://starknet.id/api/identicons/2",
profilePicture: "https://identicon.starknet.id/2",
},
{
name: undefined,
profilePicture: "https://starknet.id/api/identicons/0",
profilePicture: "https://identicon.starknet.id/0",
},
];
expect(profiles).toStrictEqual(expectedProfiles);
Expand Down
12 changes: 8 additions & 4 deletions packages/core/__test__/profile_mainnet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe("test starknetid.js sdk on mainnet", () => {
github: undefined,
discord: undefined,
proofOfPersonhood: false,
profilePicture: "https://starknet.id/api/identicons/0",
profilePicture: "https://identicon.starknet.id/0",
};
expect(profile).toStrictEqual(expectedProfile);
});
Expand All @@ -131,7 +131,7 @@ describe("test starknetid.js sdk on mainnet", () => {
github: undefined,
discord: undefined,
proofOfPersonhood: false,
profilePicture: "https://starknet.id/api/identicons/0",
profilePicture: "https://identicon.starknet.id/0",
};
expect(profile).toStrictEqual(expectedProfile);
});
Expand Down Expand Up @@ -196,15 +196,19 @@ describe("test starknetid.js sdk on mainnet", () => {
).toBeTruthy();
expect(
profiles[1].profilePicture &&
profiles[1].profilePicture.startsWith("https://starknet.id"),
profiles[1].profilePicture.startsWith(
"https://identicon.starknet.id",
),
).toBeTruthy();
expect(
profiles[2].profilePicture &&
profiles[2].profilePicture.startsWith("https://img.starkurabu.com"),
).toBeTruthy();
expect(
profiles[3].profilePicture &&
profiles[3].profilePicture.startsWith("https://starknet.id"),
profiles[3].profilePicture.startsWith(
"https://identicon.starknet.id",
),
).toBeTruthy();
expect(
profiles[4].profilePicture &&
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "starknetid.js",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [
"starknet",
"starknetid",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/starknetIdNavigator/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export class StarknetIdNavigator implements StarknetIdNavigatorInterface {
? parseBase64Image(profilePictureMetadata)
: await fetchImageUrl(profilePictureMetadata)
: useDefaultPfp
? `https://starknet.id/api/identicons/${data[1][0].toString()}`
? `https://identicon.starknet.id/${data[1][0].toString()}`
: undefined;

return {
Expand Down Expand Up @@ -611,7 +611,7 @@ export class StarknetIdNavigator implements StarknetIdNavigatorInterface {
? parseBase64Image(profilePictureMetadata)
: await fetchImageUrl(profilePictureMetadata)
: useDefaultPfp
? `https://starknet.id/api/identicons/${callResult[
? `https://identicon.starknet.id/${callResult[
i * nbInstructions + 1
][0].toString()}` // result of domain_to_id
: undefined;
Expand Down
Loading