Skip to content

Commit

Permalink
add: platform parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
POLAX7 committed Jan 11, 2023
1 parent 1aa3fd8 commit 3792e76
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Sources/Core/Methods/RequestAccountMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct RequestAccountMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems = URLEncoding.queryItems(
var queryItems = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
2 changes: 2 additions & 0 deletions Sources/Core/Models/QueryName.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ public enum QueryName: String {

// error
case error

case platform
}
6 changes: 5 additions & 1 deletion Sources/Core/Utilities/URLEncoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ import Foundation

public enum URLEncoding {

static func queryItems(
static func queryGeneralItems(
appId: String,
requestId: String,
blockchain: Blockchain
) -> [QueryItem] {

let platform: String = "sdk_ios"

let queryItems = [
QueryItem(name: .appId, value: appId),
QueryItem(name: .requestId, value: requestId),
QueryItem(name: .blockchain, value: blockchain.rawValue),
QueryItem(name: .platform, value: platform)
]
return queryItems
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public struct SendEVMBasedTransactionMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems = URLEncoding.queryItems(
var queryItems = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
2 changes: 1 addition & 1 deletion Sources/EVMBase/Methods/SignEVMBaseMessageMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public struct SignEVMBaseMessageMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems = URLEncoding.queryItems(
var queryItems = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flow/Methods/AuthenticateMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public struct AuthenticateMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems = URLEncoding.queryItems(
var queryItems = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flow/Methods/SendFlowTransactionMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public struct SendFlowTransactionMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false) else {
return nil
}
var queryItems: [QueryItem] = URLEncoding.queryItems(
var queryItems: [QueryItem] = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
2 changes: 1 addition & 1 deletion Sources/Flow/Methods/SignFlowMessageMethod.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public struct SignFlowMessageMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems = URLEncoding.queryItems(
var queryItems = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public struct SignAndSendSolanaTransactionMethod: CallbackMethod {
var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: true) else {
return nil
}
var queryItems: [QueryItem] = URLEncoding.queryItems(
var queryItems: [QueryItem] = URLEncoding.queryGeneralItems(
appId: appId,
requestId: id.uuidString,
blockchain: blockchain
Expand Down

0 comments on commit 3792e76

Please sign in to comment.