generated from proofoftom/buidler-waffle-typechain-quasar
-
Notifications
You must be signed in to change notification settings - Fork 91
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 #676 from clrfund/fix/simple-user-registry-ui
Update UI for simple user registry and simple recipient registry
- Loading branch information
Showing
18 changed files
with
320 additions
and
175 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
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 type { RegistryInfo, RecipientApplicationData } from './types' | ||
import { recipientRegistryType } from './core' | ||
import SimpleRegistry from './recipient-registry-simple' | ||
import OptimisticRegistry from './recipient-registry-optimistic' | ||
import KlerosRegistry from './recipient-registry-kleros' | ||
import type { BigNumber, Signer } from 'ethers' | ||
import type { TransactionResponse } from '@ethersproject/abstract-provider' | ||
|
||
export async function getRegistryInfo(registryAddress: string): Promise<RegistryInfo> { | ||
if (recipientRegistryType === 'simple') { | ||
return await SimpleRegistry.getRegistryInfo(registryAddress) | ||
} else if (recipientRegistryType === 'optimistic') { | ||
return await OptimisticRegistry.getRegistryInfo(registryAddress) | ||
} else if (recipientRegistryType === 'kleros') { | ||
return await KlerosRegistry.getRegistryInfo(registryAddress) | ||
} else { | ||
throw new Error('Invalid recipient registry type: ' + recipientRegistryType) | ||
} | ||
} | ||
|
||
export async function addRecipient( | ||
registryAddress: string, | ||
recipientApplicationData: RecipientApplicationData, | ||
deposit: BigNumber, | ||
signer: Signer, | ||
): Promise<TransactionResponse> { | ||
if (recipientRegistryType === 'simple') { | ||
return await SimpleRegistry.addRecipient(registryAddress, recipientApplicationData, signer) | ||
} else if (recipientRegistryType === 'optimistic') { | ||
return await OptimisticRegistry.addRecipient(registryAddress, recipientApplicationData, deposit, signer) | ||
} else if (recipientRegistryType === 'kleros') { | ||
throw new Error('Kleros recipient registry is not supported') | ||
} else { | ||
throw new Error('Invalid recipient registry type: ' + recipientRegistryType) | ||
} | ||
} |
Oops, something went wrong.