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

AppMetadata redirect #523

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion Sources/WalletConnectPairing/Types/AppMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@ import Foundation
*/
public struct AppMetadata: Codable, Equatable {

public struct Redirect: Codable, Equatable {
/// Native deeplink URL string.
public let native: String?

/// Universal link URL string.
public let universal: String?

/**
Creates a new Redirect object with the specified information.

- parameters:
- native: Native deeplink URL string.
- universal: Universal link URL string.
*/
public init(native: String?, universal: String?) {
self.native = native
self.universal = universal
}
}

/// The name of the app.
public let name: String

Expand All @@ -23,6 +43,9 @@ public struct AppMetadata: Codable, Equatable {
/// An array of URL strings pointing to the icon assets on the web.
public let icons: [String]

/// Redirect links which could be manually used on wallet side
public let redirect: Redirect?

/**
Creates a new metadata object with the specified information.

Expand All @@ -32,10 +55,11 @@ public struct AppMetadata: Codable, Equatable {
- url: The URL string that identifies the official domain of the app.
- icons: An array of URL strings pointing to the icon assets on the web.
*/
public init(name: String, description: String, url: String, icons: [String]) {
public init(name: String, description: String, url: String, icons: [String], redirect: Redirect? = nil) {
self.name = name
self.description = description
self.url = url
self.icons = icons
self.redirect = redirect
}
}