subscribeEventsV2 method
void
subscribeEventsV2({
- required dynamic onPairing(),
- required dynamic onPaired(),
- required dynamic onCallRequest(),
- required dynamic onDisconnect(),
- String? uri,
Implementation
void subscribeEventsV2({
required Function(WCPairingData?, WCProposerMeta?, String?) onPairing,
required Function(Map) onPaired,
required Function(WCCallRequestData) onCallRequest,
required Function(String) onDisconnect,
String? uri,
}) {
service.subscribeEvents(
onPairing: (Map proposal) {
final prop = WCPairingData.fromJson(proposal['proposal']);
onPairing(prop, prop.params?.proposer?.metadata, proposal['uri']);
},
onPaired: (Map session) {
onPaired(session);
},
onCallRequest: (Map payload) {
onCallRequest(WCCallRequestData.fromJson(payload));
},
onDisconnect: (uri) {
onDisconnect(uri);
},
uri: uri,
isV2: true);
}