-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support RPC 0.8.0 #530
base: main
Are you sure you want to change the base?
Support RPC 0.8.0 #530
Changes from all commits
6ff3a2f
4c2014d
625aa24
b0005b6
4587b9d
5a96c51
3c95565
d547cb7
25fdf9b
74658de
84f7dc5
5b81467
07a1f6f
12138c6
06a8fd9
31f798c
0842ce5
c77b48b
6683874
ddea038
a1358d9
74f35a2
ff8e36a
13d81ad
9097231
1384afd
54d16f6
bbd417c
b34bb52
4bf6139
97796fa
475a7f7
9a55b18
836a456
b734973
c6b4806
2725046
18ad358
54d4402
8688732
797911f
11d2eaa
6614380
303317f
a183504
635c6a6
a380e39
3af0e5c
63b8bd8
1e6190b
a8722bb
5688593
8f3061f
96dbac3
25fe29c
2b1c478
8215452
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.MessageStatus | ||
import com.swmansion.starknet.data.types.MessageStatusList | ||
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 MessageStatusListSerializer : KSerializer<MessageStatusList> { | ||
private val listSerializer = ListSerializer(MessageStatus.serializer()) | ||
|
||
@OptIn(ExperimentalSerializationApi::class) | ||
override val descriptor: SerialDescriptor = listSerialDescriptor<MessageStatus>() | ||
|
||
override fun serialize(encoder: Encoder, value: MessageStatusList) { | ||
encoder.encodeSerializableValue(listSerializer, value.values) | ||
} | ||
|
||
override fun deserialize(decoder: Decoder): MessageStatusList { | ||
val list = decoder.decodeSerializableValue(listSerializer) | ||
return MessageStatusList(list) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.swmansion.starknet.data.types | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ContractStorageKey( | ||
@SerialName("contract_address") | ||
val contractAddress: Felt, | ||
|
||
@SerialName("storage_keys") | ||
val key: List<Felt>, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.swmansion.starknet.data.types | ||
|
||
import com.swmansion.starknet.data.serializers.MessageStatusListSerializer | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable(with = MessageStatusListSerializer::class) | ||
data class MessageStatusList(val values: List<MessageStatus>) : StarknetResponse |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,12 @@ internal data class GetTransactionStatusPayload( | |
val transactionHash: Felt, | ||
) | ||
|
||
@Serializable | ||
internal data class GetMessagesStatusPayload( | ||
@SerialName("transaction_hash") | ||
val transactionHash: NumAsHex, | ||
) | ||
|
||
@Serializable | ||
internal data class EstimateTransactionFeePayload( | ||
@SerialName("request") | ||
|
@@ -83,6 +89,21 @@ internal data class GetNoncePayload( | |
override val blockId: BlockId, | ||
) : PayloadWithBlockId() | ||
|
||
@Serializable | ||
internal data class GetStorageProofPayload constructor( | ||
@SerialName("block_id") | ||
val blockId: BlockId, | ||
Comment on lines
+94
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is, please look here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it, was just checking out the changes from the tag, not branch 😅 |
||
|
||
@SerialName("class_hashes") | ||
val classHashes: List<Felt>? = null, | ||
|
||
@SerialName("contract_addresses") | ||
val contractAddresses: List<Felt>? = null, | ||
|
||
@SerialName("contract_storage_keys") | ||
val contractStorageKeys: List<ContractStorageKey>? = null, | ||
) | ||
|
||
@Serializable | ||
internal data class GetBlockWithTransactionsPayload( | ||
@SerialName("block_id") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit:
Should we introduce
ResourceBoundsMapping.ZERO
? 🤔There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also thinking about this, should be handy 👍 .