Skip to content

Commit

Permalink
feat(dashboard): add EAS network list dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
waddaboo committed Oct 10, 2024
1 parent 7085596 commit c68e955
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 3 additions & 6 deletions apps/api/src/app/credentials/credentials.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
providers,
Web2Context,
BlockchainContext,
EASContext,
EASNetworks
EASContext
} from "@bandada/credentials"
import { blockchainCredentialSupportedNetworks } from "@bandada/utils"
import { id } from "@ethersproject/hash"
Expand Down Expand Up @@ -177,7 +176,6 @@ export class CredentialsService {
accountHash = id(address + groupId)
} else if (address && credentialProvider === "eas") {
context = {
network: EASNetworks.ETHEREUM_SEPOLIA,
address: address[0]
}

Expand Down Expand Up @@ -276,7 +274,7 @@ export class CredentialsService {
group.credentials
).criteria

if (network) {
if (network && !minAttestations) {
const supportedNetwork =
blockchainCredentialSupportedNetworks.find(
(n) => n.name.toLowerCase() === network.toLowerCase()
Expand All @@ -302,9 +300,8 @@ export class CredentialsService {
}
}

if (minAttestations) {
if (network && minAttestations) {
context = {
network: EASNetworks.ETHEREUM_SEPOLIA,
address: address[0]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { validators } from "@bandada/credentials"
import { blockchainCredentialSupportedNetworks } from "@bandada/utils"
import { blockchainCredentialSupportedNetworks, easCredentialSupportedNetworks } from "@bandada/utils"
import {
Box,
Button,
Expand Down Expand Up @@ -254,7 +254,15 @@ export default function AccessModeStep({
})
}
>
{blockchainCredentialSupportedNetworks.map(
{validators[_validator].criteriaABI.minAttestations ? easCredentialSupportedNetworks.map(
(network: any) => (
<option
value={network.id}
>
{network.name}
</option>
)
) : blockchainCredentialSupportedNetworks.map(
(network: any) => (
<option
value={network.name}
Expand Down

0 comments on commit c68e955

Please sign in to comment.