File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
import Foundation
2
+ import WalletConnectNetworking
2
3
3
4
class BlockchainAPIInteractor : ObservableObject {
4
5
let store : Store
@@ -15,15 +16,18 @@ class BlockchainAPIInteractor: ObservableObject {
15
16
16
17
let address = account. address
17
18
let chainId = account. chain. absoluteString
18
-
19
+ let clientId = try ? Relay . instance. getClientId ( )
20
+
21
+
19
22
let httpClient = HTTPNetworkClient ( host: " rpc.walletconnect.com " )
20
23
let response = try await httpClient. request (
21
24
Identity . self,
22
25
at: BlockchainAPI . getIdentity (
23
26
params: . init(
24
27
address: address,
25
28
chainId: chainId,
26
- projectId: Web3Modal . config. projectId
29
+ projectId: Web3Modal . config. projectId,
30
+ clientId: clientId
27
31
)
28
32
)
29
33
)
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ enum BlockchainAPI: HTTPService {
5
5
let address : String
6
6
let chainId : String
7
7
let projectId : String
8
+ let clientId : String ?
8
9
}
9
10
10
11
case getIdentity( params: GetIdentityParams )
@@ -28,10 +29,14 @@ enum BlockchainAPI: HTTPService {
28
29
var queryParameters : [ String : String ] ? {
29
30
switch self {
30
31
case let . getIdentity( params) :
31
- return [
32
+ var parameters : [ String : String ] = [
32
33
" projectId " : params. projectId,
33
- " chainId " : params. chainId,
34
+ " chainId " : params. chainId
34
35
]
36
+ if let clientId = params. clientId {
37
+ parameters [ " clientId " ] = clientId
38
+ }
39
+ return parameters
35
40
}
36
41
}
37
42
You can’t perform that action at this time.
0 commit comments