Skip to content

Commit e154916

Browse files
authored
Support New Business Products (#132)
* merge master * increment version * add updated specs
1 parent 1dc4358 commit e154916

10 files changed

Lines changed: 5242 additions & 5011 deletions

File tree

.polygon/rest.json

Lines changed: 338 additions & 503 deletions
Large diffs are not rendered by default.

.polygon/websocket.json

Lines changed: 4675 additions & 4342 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package io.polygon.kotlin.sdk
22

33
object Version {
4-
const val name = "v4.4.0"
4+
const val name = "v4.6.0"
55
const val userAgent = "Polygon.io JVM Client/$name"
66
}

src/main/kotlin/io/polygon/kotlin/sdk/rest/crypto/Snapshots.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ data class CryptoTickerSnapshotDTO(
9595
val day: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
9696
val lastTrade: CryptoTickDTO = CryptoTickDTO(),
9797
val min: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
98-
val prevDay: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO()
98+
val prevDay: CryptoSnapshotAggregateDTO = CryptoSnapshotAggregateDTO(),
99+
val fmv: Double? = null
99100
)
100101

101102
@Serializable
@@ -122,4 +123,4 @@ data class CryptoSnapshotAggregateDTO(
122123
data class CryptoBidOrAskDTO(
123124
@SerialName("p") val price: Double? = null,
124125
@SerialName("x") val exchangeToSizeMap: Map<String, Double> = emptyMap()
125-
)
126+
)

src/main/kotlin/io/polygon/kotlin/sdk/rest/forex/Snapshots.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ data class SnapshotForexTickerDTO(
4545
val day: SnapshotAggregateDTO = SnapshotAggregateDTO(),
4646
val min: SnapshotAggregateDTO = SnapshotAggregateDTO(),
4747
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO(),
48-
val lastQuote: SnapshotForexQuoteDTO = SnapshotForexQuoteDTO()
48+
val lastQuote: SnapshotForexQuoteDTO = SnapshotForexQuoteDTO(),
49+
val fmv: Double? = null
4950
)
5051

5152
@Serializable
@@ -54,4 +55,4 @@ data class SnapshotForexQuoteDTO(
5455
@SerialName("b") val bid: Double? = null,
5556
@SerialName("x") val exchange: Long? = null,
5657
@SerialName("t") val timestamp: Long? = null
57-
)
58+
)

src/main/kotlin/io/polygon/kotlin/sdk/rest/options/Snapshots.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ data class Snapshot(
9696
@SerialName("last_quote") val lastQuote: SnapshotLastQuote? = null,
9797
@SerialName("open_interest") val openInterest: Double? = null,
9898
@SerialName("underlying_asset") val underlyingAsset: SnapshotUnderlyingAssetInfo? = null,
99+
@SerialName("fmv") val fairMarketValue: Double? = null,
99100
)
100101

101102
@Serializable

src/main/kotlin/io/polygon/kotlin/sdk/rest/stocks/Snapshots.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ data class SnapshotTickerDTO(
6262
val lastTrade: SnapshotLastTradeDTO = SnapshotLastTradeDTO(),
6363
val lastQuote: SnapshotLastQuoteDTO = SnapshotLastQuoteDTO(),
6464
val min: SnapshotAggregateDTO = SnapshotAggregateDTO(),
65-
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO()
65+
val prevDay: SnapshotAggregateDTO = SnapshotAggregateDTO(),
66+
val fmv: Double? = null
6667
)
6768

6869
@Serializable
@@ -93,4 +94,4 @@ data class SnapshotLastTradeDTO(
9394
@SerialName("c3") val cond3: Long? = null,
9495
@SerialName("c4") val cond4: Long? = null,
9596
@SerialName("t") val timestamp: Long? = null
96-
)
97+
)

src/main/kotlin/io/polygon/kotlin/sdk/websocket/PolygonWebSocketClient.kt

Lines changed: 202 additions & 158 deletions
Large diffs are not rendered by default.

src/main/kotlin/io/polygon/kotlin/sdk/websocket/PolygonWebSocketMessage.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,15 @@ sealed class PolygonWebSocketMessage {
262262
) : LaunchpadMessage()
263263

264264
}
265-
}
265+
266+
sealed class BusinessMessage : PolygonWebSocketMessage() {
267+
268+
@Serializable
269+
data class FairMarketValue(
270+
@SerialName("ev") val eventType: String? = null,
271+
@SerialName("fmv") val value: Double? = null,
272+
@SerialName("sym") val symbol: String? = null,
273+
@SerialName("t") val timestampMillis: Long? = null
274+
) : BusinessMessage()
275+
}
276+
}

src/main/kotlin/io/polygon/kotlin/sdk/websocket/PolygonWebSocketSubscription.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ sealed class PolygonWebSocketChannel(val prefix: String) {
9898
object Value : Indices("V")
9999
}
100100

101+
sealed class Business(channelPrefix: String) : PolygonWebSocketChannel(channelPrefix) {
102+
object FairMarketValue : Business("FMV")
103+
}
104+
101105
/**
102106
* Use this if there's a new channel that this SDK doesn't fully support yet
103107
*/

0 commit comments

Comments
 (0)