-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename from
minDepositAmount
to minStakeAmount
- Loading branch information
1 parent
904ddcf
commit 3766428
Showing
7 changed files
with
23 additions
and
23 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from "./useInitializeAcreSdk" | ||
export * from "./useFetchMinDepositAmount" | ||
export * from "./useFetchMinStakeAmount" | ||
export * from "./useFetchSdkData" |
12 changes: 6 additions & 6 deletions
12
...src/hooks/sdk/useFetchMinDepositAmount.ts → dapp/src/hooks/sdk/useFetchMinStakeAmount.ts
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
import { useEffect } from "react" | ||
import { setMinDepositAmount } from "#/store/btc" | ||
import { setMinStakeAmount } from "#/store/btc" | ||
import { logPromiseFailure } from "#/utils" | ||
import { useAcreContext } from "#/acre-react/hooks" | ||
import { useAppDispatch } from "../store/useAppDispatch" | ||
|
||
export function useFetchMinDepositAmount() { | ||
export function useFetchMinStakeAmount() { | ||
const { acre, isInitialized } = useAcreContext() | ||
const dispatch = useAppDispatch() | ||
|
||
useEffect(() => { | ||
if (!isInitialized || !acre) return | ||
|
||
const fetchMinDepositAmount = async () => { | ||
const fetchMinStakeAmount = async () => { | ||
// TODO: Use function from SDK | ||
const minDepositAmount = await new Promise<bigint>((resolve) => { | ||
const minStakeAmount = await new Promise<bigint>((resolve) => { | ||
resolve(BigInt(String(1e4))) // 0.0001 BTC | ||
}) | ||
|
||
dispatch(setMinDepositAmount(minDepositAmount)) | ||
dispatch(setMinStakeAmount(minStakeAmount)) | ||
} | ||
|
||
logPromiseFailure(fetchMinDepositAmount()) | ||
logPromiseFailure(fetchMinStakeAmount()) | ||
}, [acre, dispatch, isInitialized]) | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { useFetchMinDepositAmount } from "./useFetchMinDepositAmount" | ||
import { useFetchMinStakeAmount } from "./useFetchMinStakeAmount" | ||
|
||
export function useFetchSdkData() { | ||
useFetchMinDepositAmount() | ||
useFetchMinStakeAmount() | ||
} |
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