@dialectlabs/blinks-core
Advanced tools
Comparing version 0.16.4 to 0.16.5
@@ -498,2 +498,3 @@ import { ActionGetResponse, SignMessageData as SignMessageData$1, NextActionLink, PostNextActionLink, MessageNextActionPostRequest, NextActionPostRequest, NextAction, LinkedActionType, TypedActionParameter, ActionPostRequest, ActionPostResponse, GeneralParameterType, SelectableParameterType } from '@solana/actions-spec'; | ||
id: string; | ||
wallet?: string; | ||
} | ||
@@ -514,3 +515,3 @@ interface BlinkList { | ||
} | ||
declare const useBlinkList: ({ id }: UseBlinkListOptions) => { | ||
declare const useBlinkList: ({ id, wallet }: UseBlinkListOptions) => { | ||
loading: boolean; | ||
@@ -520,3 +521,3 @@ refetch: () => () => void; | ||
}; | ||
declare function fetchBlinkList(id: string): Promise<BlinkList>; | ||
declare function fetchBlinkList(id: string, wallet: string | undefined): Promise<BlinkList>; | ||
@@ -523,0 +524,0 @@ interface UseMetadataArgs { |
@@ -223,3 +223,3 @@ // src/utils/caip-2.ts | ||
name: "@dialectlabs/blinks-core", | ||
version: "0.16.4", | ||
version: "0.16.5", | ||
license: "Apache-2.0", | ||
@@ -1753,3 +1753,3 @@ private: false, | ||
import { useCallback as useCallback2, useEffect as useEffect4, useState as useState4 } from "react"; | ||
var useBlinkList = ({ id }) => { | ||
var useBlinkList = ({ id, wallet }) => { | ||
const [loading, setLoading] = useState4(false); | ||
@@ -1760,3 +1760,3 @@ const [data, setData] = useState4(); | ||
setLoading(true); | ||
fetchBlinkList(id).then((data2) => { | ||
fetchBlinkList(id, wallet).then((data2) => { | ||
if (!ignore) { | ||
@@ -1773,3 +1773,3 @@ setData(data2); | ||
}; | ||
}, [id]); | ||
}, [id, wallet]); | ||
useEffect4(() => { | ||
@@ -1787,14 +1787,17 @@ const cancel = refetch(); | ||
}; | ||
async function fetchBlinkList(id) { | ||
async function fetchBlinkList(id, wallet) { | ||
try { | ||
const response = await fetch( | ||
`https://registry.dial.to/v1/private/blink-lists/${id}`, | ||
{ | ||
method: "GET", | ||
headers: { | ||
Accept: "application/json", | ||
...clientKey && { [BLINK_CLIENT_KEY_HEADER]: clientKey } | ||
} | ||
const urlObj = new URL( | ||
`https://registry.dial.to/v1/private/blink-lists/${id}` | ||
); | ||
if (wallet) { | ||
urlObj.searchParams.append("account", wallet); | ||
} | ||
const response = await fetch(urlObj, { | ||
method: "GET", | ||
headers: { | ||
Accept: "application/json", | ||
...clientKey && { [BLINK_CLIENT_KEY_HEADER]: clientKey } | ||
} | ||
); | ||
}); | ||
if (!response.ok) { | ||
@@ -1801,0 +1804,0 @@ console.error( |
{ | ||
"name": "@dialectlabs/blinks-core", | ||
"version": "0.16.4", | ||
"version": "0.16.5", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "private": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
160577
4264