feat: merge api (#658)

This commit is contained in:
Cafe137
2024-06-03 15:07:01 -07:00
committed by GitHub
parent b3f521ca20
commit 8cbd812a2c
43 changed files with 218 additions and 717 deletions
+5 -3
View File
@@ -11,7 +11,7 @@ interface Props {
}
export default function StakeModal({ onStarted, onFinished }: Props): ReactElement {
const { beeDebugApi } = useContext(SettingsContext)
const { beeApi } = useContext(SettingsContext)
const { refresh } = useContext(BeeContext)
return (
@@ -23,12 +23,14 @@ export default function StakeModal({ onStarted, onFinished }: Props): ReactEleme
icon={<Download size="1rem" />}
min={new BigNumber(0)}
action={async (amount: bigint) => {
if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')
if (!beeApi) {
throw new Error('Bee URL is not valid')
}
onStarted()
try {
await beeDebugApi.depositStake(amount.toString())
await beeApi.depositStake(amount.toString())
} finally {
refresh()
onFinished()