Skip to content

Commit 8093b3e

Browse files
feat: option to URL encode EIP681 link before it's returned
1 parent 232b6b1 commit 8093b3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/web3swift/Utils/EIP/EIP681.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ extension Web3 {
6060
<<<<<<< HEAD
6161
=======
6262

63-
public func makeEIP681Link() -> String? {
63+
public func makeEIP681Link(urlEncode: Bool = false) -> String? {
6464
let address: String
6565
switch targetAddress {
6666
case .ethereumAddress(let ethereumAddress):
@@ -87,7 +87,7 @@ extension Web3 {
8787
link = "\(link)?\(queryParameters.joined(separator: "&"))"
8888
}
8989
}
90-
return link
90+
return urlEncode ? link.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) : link
9191
}
9292
}
9393

0 commit comments

Comments
 (0)