From 53f0922a1b43bae924db630cb5685d76e0bd63dc Mon Sep 17 00:00:00 2001 From: Patrice Tisserand Date: Wed, 19 Feb 2025 16:53:00 +0100 Subject: [PATCH] docs: update JSON RPC 0.7.1 support --- docs/index.mdx | 43 +----------------- docs/packages/starknet-builder.mdx | 13 +++++- docs/packages/starknet-provider.mdx | 67 +++++++++++++++++++++++++++- packages/starknet_provider/README.md | 61 ++++++++++++++++++++++--- 4 files changed, 135 insertions(+), 49 deletions(-) diff --git a/docs/index.mdx b/docs/index.mdx index b4fa235b..9544a705 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -8,50 +8,11 @@ The goal of this SDK is to be able to interact with StarkNet smart contracts in ## StarkNet Features Compatibility ### Transaction - | Feature | State | Version | | -------------- | ------------------ | ------- | | invoke | ✅ | 0, 1, 3 | | declare | ✅ | 1, 2, 3 | | deploy_account | ✅ | 1, 3 | -### Supported RPC methods for JSON RPC v0.7.1 - -| Feature | State | -| ---------------------------------------- | ------------------ | -| **Read** | -| starknet_getBlockWithTxHashes | ✅ | -| starknet_getBlockWithTxs | ✅ | -| starknet_getStateUpdate | ✅ | -| starknet_getStorageAt | ✅ | -| starknet_getTransactionByHash | ✅ | -| starknet_getTransactionByBlockIdAndIndex | ✅ | -| starknet_getTransactionReceipt | ✅ | -| starknet_getClass | ✅ | -| starknet_getClassHashAt | ✅ | -| starknet_getClassAt | ✅ | -| starknet_getBlockTransactionCount | ✅ | -| starknet_call | ✅ | -| starknet_estimateFee | ✅ | -| starknet_blockNumber | ✅ | -| starknet_blockHashAndNumber | ✅ | -| starknet_chainId | ✅ | -| starknet_pendingTransactions | ✅ | -| starknet_syncing | ✅ | -| starknet_getEvents | ✅ | -| starknet_getNonce | ✅ | -| **Write** | -| starknet_addInvokeTransaction | ✅ | -| starknet_addDeclareTransaction | ✅ | -| starknet_addDeployAccountTransaction | ✅ | - -### Source code generation from contract ABI - -| Feature | Cairo 0 (legacy) | Cairo 1 | Cairo 2 | -|--------------|--------------------|--------------------|--------------------| -| call | ✅ | ✅ | ❌ | -| invoke | ✅ | ✅ | ❌ | -| core types | ✅ | 🚧 | ❌ | -| custom types | ✅ | 🚧 | ❌ | -| event | ❌ | ❌ | ❌ | - +### Supported JSON RPC version: 0.7.1 +[See Starknet Provider supported methods](/packages/starknet-provider#supported-json-rpc-methods) \ No newline at end of file diff --git a/docs/packages/starknet-builder.mdx b/docs/packages/starknet-builder.mdx index 7e093d44..62ff16cd 100644 --- a/docs/packages/starknet-builder.mdx +++ b/docs/packages/starknet-builder.mdx @@ -1,3 +1,14 @@ # Starknet Builder Package -**DEPRECATED PACKAGE** \ No newline at end of file +**DEPRECATED PACKAGE** + +### Source code generation from contract ABI + +| Feature | Cairo 0 (legacy) | Cairo 1 | Cairo 2 | +|--------------|--------------------|--------------------|--------------------| +| call | ✅ | ✅ | ❌ | +| invoke | ✅ | ✅ | ❌ | +| core types | ✅ | 🚧 | ❌ | +| custom types | ✅ | 🚧 | ❌ | +| event | ❌ | ❌ | ❌ | + diff --git a/docs/packages/starknet-provider.mdx b/docs/packages/starknet-provider.mdx index 41805ab6..c6e85c60 100644 --- a/docs/packages/starknet-provider.mdx +++ b/docs/packages/starknet-provider.mdx @@ -1,4 +1,69 @@ -# Call read-only method +# Starknet Provider + +A Dart package for interacting with Starknet node using JSON-RPC, following the [Starknet JSON-RPC specification](https://github.com/starkware-libs/starknet-specs.git). + +[Package documentation](https://pub.dev/documentation/starknet_provider/latest/) + +## Transaction support + +| Feature | State | Version | +| -------------- | ------------------ | ------- | +| invoke | ✅ | 0, 1, 3 | +| declare | ✅ | 1, 2, 3 | +| deploy_account | ✅ | 1, 3 | + +## Supported JSON RPC methods + +### Version: 0.7.1 + +### Read methods + +Name of methods have been extracted from [starknet-specs](https://github.com/starkware-libs/starknet-specs.git) with the following command: +```bash +jq .methods[].name ../starknet-specs/api/starknet_api_openrpc.json +``` +| Name | Implemented | +| ------------------------------------------ | ------------ | +| starknet_specVersion | ❌ | +| starknet_getBlockWithTxHashes | ✅ | +| starknet_getBlockWithTxs | ✅ | +| starknet_getBlockWithReceipts | ❌ | +| starknet_getStateUpdate | ✅ | +| starknet_getStorageAt | ✅ | +| starknet_getTransactionStatus | ❌ | +| starknet_getTransactionByHash | ✅ | +| starknet_getTransactionByBlockIdAndIndex | ✅ | +| starknet_getTransactionReceipt | ✅ | +| starknet_getClass | ✅ | +| starknet_getClassHashAt | ✅ | +| starknet_getClassAt | ✅ | +| starknet_getBlockTransactionCount | ✅ | +| starknet_call | ✅ | +| starknet_estimateFee | ✅ | +| starknet_estimateMessageFee | ❌ | +| starknet_blockNumber | ✅ | +| starknet_blockHashAndNumber | ✅ | +| starknet_chainId | ✅ | +| starknet_syncing | ✅ | +| starknet_getEvents | ✅ | +| starknet_getNonce | ✅ | + +### Write methods + +Name of methods have been extracted from [starknet-specs](https://github.com/starkware-libs/starknet-specs.git) with the following command: +```bash +jq .methods[].name ../starknet-specs/api/starknet_write_api.json +``` + +| Name | Implemented | +|--------------------------------------------|--------------| +| starknet_addInvokeTransaction | ✅ | +| starknet_addDeclareTransaction | ✅ | +| starknet_addDeployAccountTransaction | ✅ | + + +## Usage +### Call read-only method ```dart import 'package:starknet/starknet.dart'; diff --git a/packages/starknet_provider/README.md b/packages/starknet_provider/README.md index d2bfc0ef..10046748 100644 --- a/packages/starknet_provider/README.md +++ b/packages/starknet_provider/README.md @@ -1,11 +1,60 @@ -# Starknet provider +# Starknet Provider -Starknet provider for Dart and Flutter applications +A Dart package for interacting with Starknet node using JSON-RPC, following the [Starknet JSON-RPC specification](https://github.com/starkware-libs/starknet-specs.git). -### Transaction support + +## Transaction support | Feature | State | Version | | -------------- | ------------------ | ------- | -| invoke | ✅ | 0, 1, 3 | -| declare | ✅ | 1, 2, 3 | -| deploy_account | ✅ | 1, 3 | +| invoke | ✅ | 0, 1, 3 | +| declare | ✅ | 1, 2, 3 | +| deploy_account | ✅ | 1, 3 | + +## Supported JSON RPC version: 0.7.1 + +### Read methods + +Name of methods have been extracted from [starknet-specs](https://github.com/starkware-libs/starknet-specs.git) with the following command: +```bash +jq .methods[].name ../starknet-specs/api/starknet_api_openrpc.json +``` +| Name | Implemented | +| ------------------------------------------ | ------------ | +| starknet_specVersion | ❌ | +| starknet_getBlockWithTxHashes | ✅ | +| starknet_getBlockWithTxs | ✅ | +| starknet_getBlockWithReceipts | ❌ | +| starknet_getStateUpdate | ✅ | +| starknet_getStorageAt | ✅ | +| starknet_getTransactionStatus | ❌ | +| starknet_getTransactionByHash | ✅ | +| starknet_getTransactionByBlockIdAndIndex | ✅ | +| starknet_getTransactionReceipt | ✅ | +| starknet_getClass | ✅ | +| starknet_getClassHashAt | ✅ | +| starknet_getClassAt | ✅ | +| starknet_getBlockTransactionCount | ✅ | +| starknet_call | ✅ | +| starknet_estimateFee | ✅ | +| starknet_estimateMessageFee | ❌ | +| starknet_blockNumber | ✅ | +| starknet_blockHashAndNumber | ✅ | +| starknet_chainId | ✅ | +| starknet_syncing | ✅ | +| starknet_getEvents | ✅ | +| starknet_getNonce | ✅ | + +### Write methods + +Name of methods have been extracted from [starknet-specs](https://github.com/starkware-libs/starknet-specs.git) with the following command: +```bash +jq .methods[].name ../starknet-specs/api/starknet_write_api.json +``` + +| Name | Implemented | +|--------------------------------------------|--------------| +| starknet_addInvokeTransaction | ✅ | +| starknet_addDeclareTransaction | ✅ | +| starknet_addDeployAccountTransaction | ✅ | +