-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…uests [Networking] #502 Add tll and prompt to requests
- Loading branch information
Showing
44 changed files
with
319 additions
and
306 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,28 @@ | ||
import Foundation | ||
import WalletConnectNetworking | ||
|
||
enum AuthProtocolMethod: String, ProtocolMethod { | ||
case authRequest = "wc_authRequest" | ||
case pairingDelete = "wc_pairingDelete" | ||
case pairingPing = "wc_pairingPing" | ||
|
||
var method: String { | ||
return self.rawValue | ||
} | ||
|
||
var requestTag: Int { | ||
switch self { | ||
case .authRequest: | ||
return 3000 | ||
case .pairingDelete: | ||
return 1000 | ||
case .pairingPing: | ||
return 1002 | ||
} | ||
} | ||
|
||
var responseTag: Int { | ||
switch self { | ||
case .authRequest: | ||
return 3001 | ||
case .pairingDelete: | ||
return 1001 | ||
case .pairingPing: | ||
return 1003 | ||
} | ||
} | ||
struct AuthRequestProtocolMethod: ProtocolMethod { | ||
let method: String = "wc_authRequest" | ||
|
||
let requestConfig = RelayConfig(tag: 3000, prompt: true, ttl: 86400) | ||
|
||
let responseConfig = RelayConfig(tag: 3001, prompt: false, ttl: 86400) | ||
} | ||
|
||
|
||
struct PairingPingProtocolMethod: ProtocolMethod { | ||
let method: String = "wc_pairingPing" | ||
|
||
let requestConfig = RelayConfig(tag: 1002, prompt: false, ttl: 30) | ||
|
||
let responseConfig = RelayConfig(tag: 1003, prompt: false, ttl: 30) | ||
} | ||
|
||
|
||
struct PairingDeleteProtocolMethod: ProtocolMethod { | ||
let method: String = "wc_pairingDelete" | ||
|
||
let requestConfig = RelayConfig(tag: 1000, prompt: false, ttl: 86400) | ||
|
||
let responseConfig = RelayConfig(tag: 1001, prompt: false, ttl: 86400) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,20 @@ | ||
import Foundation | ||
import WalletConnectNetworking | ||
|
||
enum ChatProtocolMethod: ProtocolMethod { | ||
case invite | ||
case message | ||
|
||
var requestTag: Int { | ||
switch self { | ||
case .invite: | ||
return 2000 | ||
case .message: | ||
return 2002 | ||
} | ||
} | ||
|
||
var responseTag: Int { | ||
switch self { | ||
case .invite: | ||
return 2001 | ||
case .message: | ||
return 2003 | ||
} | ||
} | ||
|
||
var method: String { | ||
switch self { | ||
case .invite: | ||
return "wc_chatInvite" | ||
case .message: | ||
return "wc_chatMessage" | ||
} | ||
} | ||
struct ChatInviteProtocolMethod: ProtocolMethod { | ||
let method: String = "wc_chatInvite" | ||
|
||
let requestConfig = RelayConfig(tag: 2000, prompt: true, ttl: 86400) | ||
|
||
let responseConfig = RelayConfig(tag: 2001, prompt: false, ttl: 86400) | ||
|
||
} | ||
|
||
struct ChatMessageProtocolMethod: ProtocolMethod { | ||
let method: String = "wc_chatMessage" | ||
|
||
let requestConfig = RelayConfig(tag: 2002, prompt: true, ttl: 86400) | ||
|
||
let responseConfig = RelayConfig(tag: 2003, prompt: false, ttl: 86400) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.