-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from WalletConnect/rejection-reasons
Rejection reasons
- Loading branch information
Showing
7 changed files
with
31 additions
and
9 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
import Foundation | ||
|
||
/// https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-25.md | ||
public enum RejectionReason { | ||
case disapprovedChains | ||
case disapprovedMethods | ||
case disapprovedNotificationTypes | ||
} | ||
|
||
internal extension RejectionReason { | ||
func internalRepresentation() -> SessionType.Reason { | ||
switch self { | ||
case .disapprovedChains: | ||
return SessionType.Reason(code: 5000, message: "User disapproved requested chains") | ||
case .disapprovedMethods: | ||
return SessionType.Reason(code: 5001, message: "User disapproved requested json-rpc methods") | ||
case .disapprovedNotificationTypes: | ||
return SessionType.Reason(code: 5002, message: "User disapproved requested notification types") | ||
} | ||
} | ||
} |
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
File renamed without changes.
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