Skip to content

Commit

Permalink
add prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Oct 17, 2023
1 parent 3828b0a commit b624105
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/network.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import capitalize from "./capitalize"
import {ADDRESS_REGEXP, NETWORK_CODEWORDS} from "./constants"
import publicConfig from "./publicConfig"
import * as fcl from "@onflow/fcl"

export const NETWORK_DISPLAY_NAME = capitalize(publicConfig.network)

Expand All @@ -23,6 +24,7 @@ export function isValidNetworkAddress(
address: string,
network: keyof typeof NETWORK_CODEWORDS
) {
address = fcl.withPrefix(address) || ""
if (ADDRESS_REGEXP.test(address) === false) return false

let codeword = BigInt(address) ^ BigInt(NETWORK_CODEWORDS[network])
Expand Down

0 comments on commit b624105

Please sign in to comment.