Skip to content

Conversation

@franciszekjob
Copy link
Collaborator

@franciszekjob franciszekjob commented Oct 24, 2024

Describe your changes

Add support for RPC 0.8.1

  • starknet_getStorageProof
    • Add StarknetGetStorageProofResponse, StarknetGlobalRoots, StarknetContractsProof, StarknetContractLeafData, StarknetNodeHashToNodeMappingItem, StarknetBinaryNode, StarknetEdgeNode, StarknetContractsStorageKey structs
    • Add getStorageProof method in StarknetRequest
  • starknet_getMessagesStatus
    • Add StarknetMessageStatus struct
    • Add getMessagesStatus method in StarknetRequest
  • Adapt execution resources to new receipt
    • StarknetAccountProtocol:
      • signDeployAccountV3 has now resourceBounds param instead of l1ResourceBounds
    • StarknetInvokeParamsV3, StarknetDeployAccountParamsV3, StarknetOptionalInvokeParamsV3:
      • Change l1ResourceBounds param to resourceBounds in constructors
    • StarknetFeeEstimate :
      • rename gasConsumed to l1GasConsumed
      • rename gasPrice to l1GasPrice
      • rename dataGasPrice to l1DataGasPrice
      • rename dataGasConsumed to l1DataGasConsumed
      • add l2GasConsumed, l2GasPrice fields
    • Update StarknetResources protocol to have only l1Gas and l2Gas fields
    • Update StarknetExecutionResources fields
    • Remove StarknetDataAvailability and StarknetComputationResources
    • Add StarknetInnerCallExecutionResources
    • Remove constructor accepting only l1Gas in StarknetResourceBoundsMapping
    • Rename computationResources to executionResources in StarknetFunctionInvocation and change its type to StarknetInnerCallExecutionResources instead of StarknetComputationResources
  • Add failureReason to StarknetGetTransactionStatusResponse
  • Add isReverted to StarknetFunctionInvocation

Linked issues

Closes #219

Breaking changes

  • This issue contains breaking changes
  • Not compatible with JSON-RPC 0.7.0 spec
  • Use resourceBounds instead of l1ResourceBounds param
  • StarknetComputationResources has been removed; StarknetExecutionResources and StarknetFeeEstimate have been updated
  • StarknetFeeEstimate gas values are now of type UInt64AsHex (for amounts) and UInt128AsHex (for prices)

@franciszekjob franciszekjob marked this pull request as draft October 24, 2024 22:45
@franciszekjob franciszekjob changed the title Support JSON RPC 0.8.0 Support RPC 0.8.0 Oct 25, 2024
@franciszekjob franciszekjob removed the request for review from DelevoXDG October 28, 2024 08:33
@franciszekjob franciszekjob changed the title Support RPC 0.8.0 Support RPC 0.8.1 Apr 14, 2025
Comment on lines -64 to -72
func createAccount(
name: String,
classHash: Felt = DevnetClientConstants.accountContractClassHash,
salt: Felt? = .zero
) async throws -> CreateAccountResult {
try await createAccount(
name: name,
classHash: classHash,
salt: salt
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Can be removed as it was redundant

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I refactored these tests (similar as in JVM), there's not need to test multiplication in the same way multiple times. Should make more sense now.

@franciszekjob franciszekjob requested a review from DelevoXDG April 17, 2025 16:19
@franciszekjob franciszekjob requested a review from DelevoXDG April 17, 2025 18:27
Copy link
Collaborator

@DelevoXDG DelevoXDG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@franciszekjob franciszekjob merged commit eb067b6 into main Apr 18, 2025
1 check passed
@franciszekjob franciszekjob deleted the feat/219-rpc-0.8.0 branch April 18, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support JSON-RPC v0.8.0

3 participants