-
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.
- Loading branch information
1 parent
712fa68
commit 89979ef
Showing
5 changed files
with
28 additions
and
6 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,21 @@ | ||
import { providers } from 'ethers'; | ||
import { AuroraNetwork } from '../types/network'; | ||
import { config } from '../config'; | ||
import { getUserShares } from './staking'; | ||
|
||
/** | ||
* Confirm that a user's account has shares. | ||
*/ | ||
export const hasShares = async ( | ||
network: AuroraNetwork, | ||
address: string, | ||
): Promise<boolean> => { | ||
const networkConfig = config[network]; | ||
const { rpcUrl } = networkConfig; | ||
const provider = new providers.JsonRpcProvider(rpcUrl); | ||
|
||
// Confirm that account has shares | ||
const userShares = await getUserShares(address, 0, provider, networkConfig); | ||
|
||
return !userShares.isZero(); | ||
}; |
File renamed without changes.
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