-
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.
fix: update API evmVersion + solidityCompiler
- Loading branch information
Tien Nam Dao
committed
Nov 21, 2022
1 parent
c367863
commit 61bea0e
Showing
11 changed files
with
105 additions
and
52 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
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,20 @@ | ||
import API_LIST from 'api/api_list' | ||
import { useEffect, useState } from 'react' | ||
import useSWRImmutable from 'swr/immutable' | ||
|
||
const useEvmVersion = (): string[] => { | ||
const [evmVersions, setEvmVersions] = useState([]) | ||
const _fetchCondition = () => { | ||
return [API_LIST.GET_EVM_VERSION] | ||
} | ||
const { data } = useSWRImmutable<any>(_fetchCondition()) | ||
|
||
useEffect(() => { | ||
if (data && data?.result) { | ||
setEvmVersions(data?.result?.versions) | ||
} | ||
}, [data]) | ||
return evmVersions || [] | ||
} | ||
|
||
export default useEvmVersion |
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,20 @@ | ||
import API_LIST from 'api/api_list' | ||
import { useEffect, useState } from 'react' | ||
import useSWRImmutable from 'swr/immutable' | ||
|
||
const useSolidityCompiler = (): string[] => { | ||
const [evmVersions, setEvmVersions] = useState([]) | ||
const _fetchCondition = () => { | ||
return [API_LIST.GET_SOLIDITY_COMPILER] | ||
} | ||
const { data } = useSWRImmutable<any>(_fetchCondition()) | ||
|
||
useEffect(() => { | ||
if (data && data?.result) { | ||
setEvmVersions(data?.result?.versions) | ||
} | ||
}, [data]) | ||
return evmVersions || [] | ||
} | ||
|
||
export default useSolidityCompiler |
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
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