Skip to content

Commit

Permalink
Merge pull request #760 from WalletConnect/feature/rfc3986
Browse files Browse the repository at this point in the history
[Web3Wallet] RFC3986
  • Loading branch information
flypaper0 authored Mar 27, 2023
2 parents 447f05e + 5bf8f90 commit ee90746
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/WalletConnectUtils/Extensions/CharacterSet.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import Foundation

extension CharacterSet {

public static var rfc3986: CharacterSet {
return .alphanumerics.union(CharacterSet(charactersIn: "-._~"))
}
}
5 changes: 5 additions & 0 deletions Sources/WalletConnectUtils/WalletConnectURI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public struct WalletConnectURI: Equatable {
return "wc:\(topic)@\(version)?symKey=\(symKey)&\(relayQuery)"
}

public var deeplinkUri: String {
return absoluteString
.addingPercentEncoding(withAllowedCharacters: .rfc3986) ?? absoluteString
}

public init(topic: String, symKey: String, relay: RelayProtocolOptions) {
self.version = "2"
self.topic = topic
Expand Down

0 comments on commit ee90746

Please sign in to comment.