Skip to content

Commit 4bdd6d9

Browse files
authored
fix: return an array of accounts on connect (#186)
1 parent a5534f4 commit 4bdd6d9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Alternatively, you can add the URL directly in your project's package file:
5454
dependencies: [
5555
.package(
5656
url: "https://github.com/MetaMask/metamask-ios-sdk",
57-
from: "0.8.1"
57+
from: "0.8.6"
5858
)
5959
]
6060
```

Sources/metamask-ios-sdk/Classes/Ethereum/Ethereum.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public class Ethereum {
198198
}
199199

200200
@discardableResult
201-
func connect() async -> Result<String, RequestError> {
202-
await performAsyncOperation(connect(), defaultValue: String()) as Result<String, RequestError>
201+
func connect() async -> Result<[String], RequestError> {
202+
await performAsyncOperation(connect(), defaultValue: []) as Result<[String], RequestError>
203203
}
204204

205205
func connectAndSign(message: String) -> EthereumPublisher? {
@@ -811,7 +811,7 @@ public class Ethereum {
811811
let accounts = event["accounts"] as? [String],
812812
let selectedAddress = accounts.first {
813813
updateAccount(selectedAddress)
814-
sendResult(selectedAddress, id: Ethereum.CONNECTION_ID)
814+
sendResult(accounts, id: Ethereum.CONNECTION_ID)
815815
}
816816
return
817817
}

Sources/metamask-ios-sdk/Classes/SDK/MetaMaskSDK.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class MetaMaskSDK: ObservableObject {
102102
}
103103

104104
public extension MetaMaskSDK {
105-
func connect() async -> Result<String, RequestError> {
105+
func connect() async -> Result<[String], RequestError> {
106106
await ethereum.connect()
107107
}
108108

metamask-ios-sdk.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'metamask-ios-sdk'
3-
s.version = '0.8.5'
3+
s.version = '0.8.6'
44
s.summary = 'Enable users to easily connect with their MetaMask Mobile wallet.'
55
s.swift_version = '5.5'
66

0 commit comments

Comments
 (0)