Files
js/contract-ui/hooks/useContractSources.ts
T
a500f0d78c refactor: Release to Publish (#851)
* change banner to commercekit

* change bg

* progress check

* a lot more progress

* minor changes

* small changes

* correct folder name

* fix copy

* ui fixes

* lots of copy fixes

* one small fix

* some more small fixes

* minor fix

* more fixes

* new publish og

* small changes

* few new cases

* small fix

* rename folder

* add redirect

* Update LaunchSection.tsx

---------

Co-authored-by: Jonas Daniels <[email protected]>
Co-authored-by: Nacho Iacovino <[email protected]>
2023-02-22 21:51:48 +00:00

18 lines
482 B
TypeScript

import { useQueryWithNetwork } from "@3rdweb-sdk/react/hooks/query/useQueryWithNetwork";
import { useSDK } from "@thirdweb-dev/react";
export function useContractSources(contractAddress?: string) {
const sdk = useSDK();
return useQueryWithNetwork(
["contract-sources", contractAddress],
async () => {
return sdk
?.getPublisher()
.fetchContractSourcesFromAddress(contractAddress || "");
},
{
enabled: !!contractAddress,
},
);
}