Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Push] Add push messages history getter, add account to subscription #675

Merged
merged 5 commits into from
Jan 25, 2023

Conversation

llbartekll
Copy link
Contributor

…lletConnect/WalletConnectSwiftV2 into add-get-push-messages

# Conflicts:
#	Sources/WalletConnectPush/Types/PushSubscription.swift
#	Sources/WalletConnectUtils/RPCHistory/RPCHistory.swift
@@ -45,6 +46,7 @@ public class WalletPushClient {
proposeResponder: PushRequestResponder,
pushMessageSubscriber: PushMessageSubscriber,
subscriptionsProvider: SubscriptionsProvider,
pushMessagesProvider: PushMessagesProvider,
deletePushSubscriptionService: DeletePushSubscriptionService,
deletePushSubscriptionSubscriber: DeletePushSubscriptionSubscriber,
resubscribeService: PushResubscribeService) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resubscribeService unused in PushClient

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is in use, it's calling setUpResubscription func after initialisation

import Foundation
import WalletConnectUtils

class PushMessagesProvider {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

public func getAll<Object: Codable>(of type: Object.Type, topic: String) -> [Object] {
return storage.getAll()
.filter{$0.topic == topic}
.compactMap { record in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.compactMap { try? $0.request.params?.get(Object.self) }

@llbartekll llbartekll merged commit a7bef52 into develop Jan 25, 2023
@llbartekll llbartekll deleted the add-get-push-messages branch January 25, 2023 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants