-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1076 from AelinXYZ/add-aumount-pre-waiver
amounts added
- Loading branch information
Showing
4 changed files
with
61 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { JsonRpcProvider } from '@ethersproject/providers' | ||
|
||
import useContractCall from './useContractCall' | ||
import swapAelin from '@/src/abis/SwapAelin.json' | ||
import { ChainsValues, getNetworkConfig } from '@/src/constants/chains' | ||
import { SwapAelin } from '@/types/typechain' | ||
|
||
export function useSwapAelinCall< | ||
MethodName extends keyof SwapAelin['functions'], | ||
Params extends Parameters<SwapAelin[MethodName]> | null, | ||
Return extends Awaited<ReturnType<SwapAelin[MethodName]>>, | ||
>( | ||
chainId: ChainsValues, | ||
address: string, | ||
method: MethodName, | ||
params: Params, | ||
): [Return | null, () => void] { | ||
const provider = new JsonRpcProvider(getNetworkConfig(chainId).rpcUrl) | ||
|
||
const [data, refetch] = useContractCall(provider, address, swapAelin, method, params) | ||
return [data, refetch] | ||
} |
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
25e033b
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:
aelin-ui-v2 – ./
aelin-ui-v2-git-pre-prod-aelin.vercel.app
aelin-ui-v2-aelin.vercel.app
app.aelin.xyz