-
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.
Merge pull request #20 from Staketab/dev
sent Payment tx, sent registration request to service
- Loading branch information
Showing
6 changed files
with
167 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export const NETWORK = 'testworld'; | ||
export const defaultWallet = 'B62qoTtn6hP2R1x5d4UQoJos9vjoNGxLhaQn5cSKneu25Q3wpmtPirT'; | ||
export const PUBLIC_APP_BASE_URL = 'https://minascan.io/'; | ||
export const POLLING_INTERVAL = 3000; | ||
export const fees = { | ||
slow: 0.0011, | ||
default: 0.0101, | ||
fast: 0.2001, | ||
}; | ||
|
||
export const accountAddress = | ||
"B62qk1sJumHSS1hPKS2fSAbxkkwGcCiieb1PcM4PB182pa1MKE9H9AV"; |
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,36 @@ | ||
import { useState, useEffect } from "react"; | ||
|
||
export type Balance = { | ||
balance: number; | ||
balanceUsd: number; | ||
}; | ||
|
||
const useAddressBalance = (address): { balance: Balance } => { | ||
const [balance, setBalance] = useState<Balance>(null); | ||
|
||
const getBalance = async (address): Promise<void> => { | ||
try { | ||
fetch( | ||
`https://minascan.io/qanet/api/api/core/accounts/${address}/balance` | ||
) | ||
.then((data) => { | ||
return data.json(); | ||
}) | ||
.then((data) => { | ||
setBalance(data); | ||
}); | ||
} catch (error) {} | ||
}; | ||
|
||
useEffect(() => { | ||
if (address) { | ||
getBalance(address); | ||
} | ||
}, [address]); | ||
|
||
return { | ||
balance, | ||
}; | ||
}; | ||
|
||
export default useAddressBalance; |
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