forked from alto-io/xgr-arcadians
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
7,815 additions
and
29,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import useSWR from "swr"; | ||
|
||
const ARCADIANS_API = "https://arcadians.dev.outplay.games/v2/arcadians/" | ||
|
||
const fetchTokenMetadata = async(uri) : Promise<any> => { | ||
|
||
const uriWithId = `${ARCADIANS_API}${uri}?refreshMetadata=true`; | ||
|
||
const response = await fetch(uriWithId); | ||
const data = await response.json(); | ||
return data; | ||
}; | ||
|
||
export const useArcadiansApi = (uri) => { | ||
const { data, error, mutate, isLoading } = useSWR( | ||
uri, | ||
fetchTokenMetadata | ||
); | ||
|
||
return { | ||
data, | ||
error, | ||
isLoading, | ||
mutate, | ||
contracts: data || [], | ||
isError: !!error, | ||
}; | ||
|
||
|
||
|
||
|
||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
b343601
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
xgr-arcadians-reloaded – ./
xgr-arcadians-reloaded.vercel.app
xgr-arcadians-reloaded-git-main-op-games.vercel.app
xgr-arcadians-reloaded-op-games.vercel.app