@@ -23,18 +23,32 @@ public struct Decryption {
2323``` swift
2424import ABCSecureChannel
2525
26- let url = URL (string : " https://dev-api.id.myabcwallet.com" )!
27- let channelManager = SecureChannelManager (host : url)
28- channelManager.encrypt (plain : password) { encryption in
29- // TODO: use callback Encrypted Model
26+ let channelManager = SecureChannelManager (host : " https://dev-api.id.myabcwallet.com" )
27+ channelManager.encrypt (plain : password) { result in
28+ switch result {
29+ case .success (let encryption):
30+ // TODO: use callback Encrypted Model
31+ case .failure (let error):
32+ // TODO: handle Error
33+ }
3034}
3135
32- channelManager.decrypt (encrypted : message) { decryption in
33- // TODO: use callback Decrypted Model
36+ channelManager.decrypt (encrypted : message) { result in
37+ switch result {
38+ case .success (let encryption):
39+ // TODO: use callback Decrypted Model
40+ case .failure (let error):
41+ // TODO: handle Error
42+ }
3443}
3544
36- channelManager.channelId () { channelId in
37- // ...
45+ channelManager.channelId () { result in
46+ switch result {
47+ case .success (let channelId):
48+ // ...
49+ case .failure (let error):
50+ // TODO: handle Error
51+ }
3852}
3953```
4054
@@ -44,8 +58,7 @@ channelManager.channelId() { channelId in
4458import ABCSecureChannel
4559import Combine
4660
47- let url = URL (string : " https://dev-api.id.myabcwallet.com" )!
48- let channelManager = SecureChannelManager (host : url)
61+ let channelManager = SecureChannelManager (host : " https://dev-api.id.myabcwallet.com" )
4962
5063channelManager
5164 .encrypt (plain : password)
@@ -72,8 +85,7 @@ channelManager
7285``` swift
7386import ABCSecureChannel
7487
75- let url = URL (string : " https://dev-api.id.myabcwallet.com" )!
76- let channelManager = SecureChannelManager (host : url)
88+ let channelManager = SecureChannelManager (host : " https://dev-api.id.myabcwallet.com" )
7789
7890Task {
7991 let encryption = try await channelManager.encrypt (plain : password)
0 commit comments