Skip to content

Commit c690c72

Browse files
committed
Add loadwallet method
1 parent 5db141b commit c690c72

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Sources/CoreRPC/Methods.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public enum RPCMethod: String, Codable {
3636
case help = "help"
3737
case listbanned = "listbanned"
3838
case listunspent = "listunspent"
39+
case loadwallet = "loadwallet"
3940
case logging = "logging"
4041
case sendrawtransaction = "sendrawtransaction"
4142
case setnetworkactive = "setnetworkactive"

Sources/CoreRPC/Wallet.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ public extension CoreRPC {
1515
return call(method: .listunspent, params: Empty())
1616
}
1717

18+
struct LoadedWallet: Decodable {
19+
let name: String
20+
let warning: String
21+
}
22+
23+
func loadWallet(name: String) -> Promise<LoadedWallet> {
24+
return call(method: .loadwallet, params: [name])
25+
}
26+
1827
struct AddressInfo: Decodable {
1928
public let address: String
2029
public let desc: String?

0 commit comments

Comments
 (0)