[SDK] Fix: SocialProfiles type changed to SocialProfile[] (#4473)

This commit is contained in:
greg
2024-09-10 09:05:39 +12:00
committed by GitHub
parent 4fcbe10ebc
commit baf1a21d69
6 changed files with 13 additions and 8 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---
Updated SocialProfiles type to be SocialProfile[]
@@ -105,7 +105,7 @@ export { useConnectionManager } from "../react/core/providers/connection-manager
// Social
export { useSocialProfiles } from "../react/core/social/useSocialProfiles.js";
export type {
SocialProfiles,
SocialProfile,
EnsProfile,
FarcasterProfile,
LensProfile,
+1 -1
View File
@@ -188,7 +188,7 @@ export { useSiweAuth } from "../react/core/hooks/auth/useSiweAuth.js";
// Social
export { useSocialProfiles } from "../react/core/social/useSocialProfiles.js";
export type {
SocialProfiles,
SocialProfile,
EnsProfile,
FarcasterProfile,
LensProfile,
+1 -1
View File
@@ -1,6 +1,6 @@
export { getSocialProfiles } from "../social/profiles.js";
export type {
SocialProfiles,
SocialProfile,
EnsProfile,
FarcasterProfile,
LensProfile,
+3 -3
View File
@@ -1,7 +1,7 @@
import type { ThirdwebClient } from "../client/client.js";
import { getThirdwebBaseUrl } from "../utils/domains.js";
import { getClientFetch } from "../utils/fetch.js";
import type { SocialProfiles } from "./types.js";
import type { SocialProfile } from "./types.js";
/**
* Fetches the wallet's available social profiles.
@@ -23,7 +23,7 @@ import type { SocialProfiles } from "./types.js";
export async function getSocialProfiles(args: {
address: string;
client: ThirdwebClient;
}): Promise<SocialProfiles> {
}): Promise<SocialProfile[]> {
const { address, client } = args;
const clientFetch = getClientFetch(client);
@@ -42,5 +42,5 @@ export async function getSocialProfiles(args: {
}
}
return (await response.json()).data as SocialProfiles;
return (await response.json()).data as SocialProfile[];
}
+2 -2
View File
@@ -34,10 +34,10 @@ export type EnsProfile = {
telegram?: string;
};
export type SocialProfiles = {
export type SocialProfile = {
type: "farcaster" | "lens" | "ens";
name?: string;
avatar?: string;
bio?: string;
metadata?: FarcasterProfile | LensProfile | EnsProfile;
}[];
};