Skip to content

Commit 9602d04

Browse files
authored
Merge pull request WalletConnect#1654 from WalletConnect/kotlin/web3wallet_emit
kotlin: add sessionEmit
2 parents 0a44aa5 + 6c271a0 commit 9602d04

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/walletkit/android/usage.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,19 @@ Web3Wallet.extendSession(extendParams) { error -> /*callback for error while ext
301301
To extend a session, create a `Wallet.Params.SessionExtend` object with the session's topic to update the session with to `Web3Wallet.extendSession`. Session is
302302
extended by 7 days.
303303

304+
### Emitting a Session
305+
306+
To emit an event, call emitSessionEvent() as follows:
307+
308+
```kotlin
309+
val sessionTopic: String = /*Topic of Session*/
310+
val event: Wallet.Model.SessiomEvent = SessionEvent(name = "accountsChanged", data = "0x000000000")
311+
312+
val sessionEmit = Wallet.Params.SessionEmit(topic = sessionTopic, chainId = "eip155:1", event = event)
313+
314+
Web3Wallet.emitSessionEvent(sessionEmit) { error -> /*callback for error while emiting an event*/ }
315+
```
316+
304317
### Session Disconnect
305318

306319
```kotlin

0 commit comments

Comments
 (0)