Skip to content

Commit

Permalink
Merge pull request #726 from WalletConnect/chain-regex
Browse files Browse the repository at this point in the history
Update regex for chains
  • Loading branch information
llbartekll committed Feb 21, 2023
2 parents fb8b5d1 + 277364a commit 3ddaa3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension SessionProposalInteractor {
if let chains = proposalNamespace.chains {
accounts = Set(
chains.compactMap {
Account($0.absoluteString + ":\(self.accounts[$0.namespace]!)")
Account($0.absoluteString + ":\(self.accounts[$0.namespace] ?? "\($0.namespace)")")
}
)
let sessionNamespace = SessionNamespace(chains: chains, accounts: accounts, methods: proposalNamespace.methods, events: proposalNamespace.events)
Expand Down
2 changes: 1 addition & 1 deletion Sources/WalletConnectUtils/Extensions/String+CAIPs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
extension String {

static let chainNamespaceRegex = "^[-a-z0-9]{3,8}$"
static let chainReferenceRegex = "^[-a-zA-Z0-9]{1,32}$"
static let chainReferenceRegex = "^[-a-zA-Z0-9_]{1,32}$"
static let accountAddressRegex = "^[a-zA-Z0-9]{1,64}$"

static func conformsToCAIP2(_ string: String) -> Bool {
Expand Down

0 comments on commit 3ddaa3c

Please sign in to comment.