-
Notifications
You must be signed in to change notification settings - Fork 19
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 #689 from subquery/fix/re-deleagtion
fix: style issue, add next ICR on indexer profile, lazy collect status, add approve allowance if user set a invalid value
- Loading branch information
Showing
15 changed files
with
131 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# SubQuery Network App | ||
|
||
dApp for indexers, consumers and delegators interact with SubQuery Network. You can find this at [https://kepler.subquery.network](https://kepler.subquery.network/) | ||
dApp for indexers, consumers and delegators interact with SubQuery Network. You can find this at | ||
[https://app.subquery.network](https://app.subquery.network/) |
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
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,32 @@ | ||
// Copyright 2020-2022 SubQuery Pte Ltd authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ApproveContract } from '@components'; | ||
import { openNotification } from '@subql/components'; | ||
|
||
import { useWeb3Store } from 'src/stores'; | ||
|
||
export const useAddAllowance = () => { | ||
const { contracts } = useWeb3Store(); | ||
|
||
const addAllowance = async (contractName: ApproveContract, allowance: string) => { | ||
try { | ||
if (!contracts) throw new Error('Contracts not available'); | ||
openNotification({ | ||
type: 'info', | ||
description: 'Allowance not enough, increase allowance first', | ||
duration: 5000, | ||
}); | ||
const tx = await contracts.sqToken.approve(contracts[contractName].address, allowance); | ||
await tx?.wait(); | ||
return tx; | ||
} catch (e) { | ||
console.error(e); | ||
throw e; | ||
} | ||
}; | ||
|
||
return { | ||
addAllowance, | ||
}; | ||
}; |
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
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
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