File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Sources/web3swift/Utils/EIP Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,12 @@ extension Web3 {
238238 return await parse ( string)
239239 }
240240
241+ // TODO: throws errors instead of returning `nil`
242+ /// Attempts to parse given string as EIP681 code.
243+ /// Note: that ENS addresses as paramteres will be attempted to be resolved into Ethereum addresses.
244+ /// Thus, make sure that given raw EIP681 code has chain ID set or default Ethereum Mainnet chan ID will be used instead.
245+ /// - Parameter string: raw, encoded EIP681 code.
246+ /// - Returns: parsed EIP681 code or `nil` is something has failed.
241247 public static func parse( _ string: String ) async -> EIP681Code ? {
242248 guard string. hasPrefix ( " ethereum: " ) else { return nil }
243249 let striped = string. components ( separatedBy: " ethereum: " )
@@ -366,7 +372,7 @@ extension Web3 {
366372 let address = try await ensModel? . getAddress ( forNode: ens)
367373 nativeValue = address
368374 } catch {
369- NSLog ( error. localizedDescription)
375+ NSLog ( " Failed to resolve ENS address (parameter nr \( inputNumber ) ). Error: \( error. localizedDescription) " )
370376 return nil
371377 }
372378 }
You can’t perform that action at this time.
0 commit comments