Skip to content

Commit

Permalink
Add default implementations to Web3Wallet interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubuid committed Mar 7, 2024
1 parent 4fc8c5f commit ebae134
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ object Web3Wallet {

interface WalletDelegate {
fun onSessionProposal(sessionProposal: Wallet.Model.SessionProposal, verifyContext: Wallet.Model.VerifyContext)
fun onSessionAuthenticated(sessionAuthenticate: Wallet.Model.SessionAuthenticate, verifyContext: Wallet.Model.VerifyContext)
fun onSessionAuthenticate(sessionAuthenticate: Wallet.Model.SessionAuthenticate, verifyContext: Wallet.Model.VerifyContext) {}
fun onSessionRequest(sessionRequest: Wallet.Model.SessionRequest, verifyContext: Wallet.Model.VerifyContext)
fun onSessionDelete(sessionDelete: Wallet.Model.SessionDelete)
fun onSessionExtend(session: Wallet.Model.Session)
Expand Down Expand Up @@ -48,7 +48,7 @@ object Web3Wallet {
}

override fun onSessionAuthenticate(sessionAuthenticate: Sign.Model.SessionAuthenticate, verifyContext: Sign.Model.VerifyContext) {
delegate.onSessionAuthenticated(sessionAuthenticate.toWallet(), verifyContext.toWallet())
delegate.onSessionAuthenticate(sessionAuthenticate.toWallet(), verifyContext.toWallet())
}

override fun onSessionRequest(sessionRequest: Sign.Model.SessionRequest, verifyContext: Sign.Model.VerifyContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.walletconnect.sign.client
interface SignInterface {
interface WalletDelegate {
fun onSessionProposal(sessionProposal: Sign.Model.SessionProposal, verifyContext: Sign.Model.VerifyContext)
fun onSessionAuthenticate(sessionAuthenticate: Sign.Model.SessionAuthenticate, verifyContext: Sign.Model.VerifyContext)
fun onSessionAuthenticate(sessionAuthenticate: Sign.Model.SessionAuthenticate, verifyContext: Sign.Model.VerifyContext) {}
fun onSessionRequest(sessionRequest: Sign.Model.SessionRequest, verifyContext: Sign.Model.VerifyContext)
fun onSessionDelete(deletedSession: Sign.Model.DeletedSession)
fun onSessionExtend(session: Sign.Model.Session)
Expand All @@ -29,7 +29,7 @@ interface SignInterface {

//Responses
fun onSessionRequestResponse(response: Sign.Model.SessionRequestResponse)
fun onSessionAuthenticateResponse(sessionAuthenticateResponse: Sign.Model.SessionAuthenticateResponse)
fun onSessionAuthenticateResponse(sessionAuthenticateResponse: Sign.Model.SessionAuthenticateResponse) {}

// Utils
fun onProposalExpired(proposal: Sign.Model.ExpiredProposal)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object WCDelegate : Web3Wallet.WalletDelegate, CoreClient.CoreDelegate {
}
}

override fun onSessionAuthenticated(sessionAuthenticate: Wallet.Model.SessionAuthenticate, verifyContext: Wallet.Model.VerifyContext) {
override fun onSessionAuthenticate(sessionAuthenticate: Wallet.Model.SessionAuthenticate, verifyContext: Wallet.Model.VerifyContext) {
sessionAuthenticateEvent = Pair(sessionAuthenticate, verifyContext)

scope.launch {
Expand Down

0 comments on commit ebae134

Please sign in to comment.