-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support batching multiple RPC requests of different types (#471)
- Loading branch information
1 parent
2dd96f2
commit 9ea2e72
Showing
52 changed files
with
814 additions
and
402 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
lib/src/main/kotlin/com/swmansion/starknet/data/serializers/BlockPolymorphicSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
.../main/kotlin/com/swmansion/starknet/data/serializers/EstimateFeeResponseListSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.swmansion.starknet.data.serializers | ||
|
||
import com.swmansion.starknet.data.types.EstimateFeeResponse | ||
import com.swmansion.starknet.data.types.EstimateFeeResponseList | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.KSerializer | ||
import kotlinx.serialization.builtins.ListSerializer | ||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.descriptors.listSerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
|
||
internal object EstimateFeeResponseListSerializer : KSerializer<EstimateFeeResponseList> { | ||
private val listSerializer = ListSerializer(EstimateFeeResponse.serializer()) | ||
|
||
@OptIn(ExperimentalSerializationApi::class) | ||
override val descriptor: SerialDescriptor = listSerialDescriptor<EstimateFeeResponse>() | ||
|
||
override fun serialize(encoder: Encoder, value: EstimateFeeResponseList) { | ||
encoder.encodeSerializableValue(listSerializer, value.values) | ||
} | ||
|
||
override fun deserialize(decoder: Decoder): EstimateFeeResponseList { | ||
val list = decoder.decodeSerializableValue(listSerializer) | ||
return EstimateFeeResponseList(list) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/src/main/kotlin/com/swmansion/starknet/data/serializers/IntResponseSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.swmansion.starknet.data.serializers | ||
|
||
import com.swmansion.starknet.data.types.IntResponse | ||
import kotlinx.serialization.KSerializer | ||
import kotlinx.serialization.descriptors.PrimitiveKind | ||
import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor | ||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
|
||
internal object IntResponseSerializer : KSerializer<IntResponse> { | ||
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("IntResponse", PrimitiveKind.INT) | ||
|
||
override fun serialize(encoder: Encoder, value: IntResponse) { | ||
encoder.encodeInt(value.value) | ||
} | ||
|
||
override fun deserialize(decoder: Decoder): IntResponse { | ||
return IntResponse(decoder.decodeInt()) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...main/kotlin/com/swmansion/starknet/data/serializers/SimulatedTransactionListSerializer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.swmansion.starknet.data.serializers | ||
|
||
import com.swmansion.starknet.data.types.SimulatedTransaction | ||
import com.swmansion.starknet.data.types.SimulatedTransactionList | ||
import kotlinx.serialization.ExperimentalSerializationApi | ||
import kotlinx.serialization.KSerializer | ||
import kotlinx.serialization.builtins.ListSerializer | ||
import kotlinx.serialization.descriptors.SerialDescriptor | ||
import kotlinx.serialization.descriptors.listSerialDescriptor | ||
import kotlinx.serialization.encoding.Decoder | ||
import kotlinx.serialization.encoding.Encoder | ||
|
||
internal object SimulatedTransactionListSerializer : KSerializer<SimulatedTransactionList> { | ||
private val listSerializer = ListSerializer(SimulatedTransaction.serializer()) | ||
|
||
@OptIn(ExperimentalSerializationApi::class) | ||
override val descriptor: SerialDescriptor = listSerialDescriptor<SimulatedTransaction>() | ||
|
||
override fun serialize(encoder: Encoder, value: SimulatedTransactionList) { | ||
encoder.encodeSerializableValue(listSerializer, value.values) | ||
} | ||
|
||
override fun deserialize(decoder: Decoder): SimulatedTransactionList { | ||
val list = decoder.decodeSerializableValue(listSerializer) | ||
return SimulatedTransactionList(list) | ||
} | ||
} |
Oops, something went wrong.