Skip to content

Commit a1fae09

Browse files
committed
Add getdescriptorinfo method
1 parent 887bea0 commit a1fae09

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Sources/CoreRPC/Descriptor.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import Foundation
2+
import PromiseKit
3+
4+
public extension CoreRPC {
5+
6+
struct DescriptorInfo: Codable {
7+
let descriptor: String
8+
let isrange: Bool
9+
let issolvable: Bool
10+
let hasprivatekeys: Bool
11+
}
12+
13+
func getDescriptorInfo(_ descriptor: String) -> Promise<DescriptorInfo> {
14+
return call(method: .getdescriptorinfo, params: [descriptor])
15+
}
16+
17+
}

Sources/CoreRPC/Methods.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public enum RPCMethod: String, Codable {
1818
case getchaintips = "getchaintips"
1919
case getchaintxstats = "getchaintxstats"
2020
case getconnectioncount = "getconnectioncount"
21+
case getdescriptorinfo = "getdescriptorinfo"
2122
case getdifficulty = "getdifficulty"
2223
case getmemoryinfo = "getmemoryinfo"
2324
case getmempoolinfo = "getmempoolinfo"

0 commit comments

Comments
 (0)