Skip to content

Commit

Permalink
docs(documentation): Add API documentation links to package docs (#461)
Browse files Browse the repository at this point in the history
* docs(documentation): Add API documentation links to package docs

- Add pub.dev API links for:
  - avnu_provider
  - starknet
  - starknet_provider
  - secure_store
  - wallet_kit

* docs(packages): Move API links from READMEs to documentation pages

- Remove API documentation links from package READMEs:

  - avnu_provider

  - starknet

  - starknet_provider

  - secure_store

  - wallet_kit

- Add API documentation links to corresponding docs pages:

  - docs/packages/avnu_provider.mdx

  - docs/packages/starknet.mdx

  - docs/packages/starknet-provider.mdx

  - docs/packages/secure-store.mdx

  - docs/packages/wallet-kit.mdx

* Resolve merge conflict in starknet-provider docs

* Resolve merge conflict in starknet-provider docs

* docs: Address PR review comments

* docs: Update starknet-provider documentation formatting

* chore: fixed PR comment conflict

* fix: PR conflicts

* chores: fixed PR

* revert changes to original encoding

* restore original encoding

---------

Co-authored-by: Patrice Tisserand <[email protected]>
  • Loading branch information
Cedarich and ptisserand authored Mar 3, 2025
1 parent f18adb7 commit fab8cd5
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 72 deletions.
1 change: 1 addition & 0 deletions docs/packages/avnu_provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

AVNU Paymaster Provider is a Dart package that provides a way to interact with the AVNU paymaster service.

📚 [API Documentation](https://pub.dev/documentation/avnu_provider/latest/)
## I. Introduction

With this provider you (as sponsor) will be able to pay your users' gas fees and you (as a user) will be able to execute gasless transactions sponsored by the sponsor. The user simply signs typed data containing the calls they want to execute. The gas fees in ETH will be paid by Avnu relayers to execute the transaction. The process is as follows:
Expand Down
1 change: 1 addition & 0 deletions docs/packages/secure-store.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The secure store is a Flutter allowing to securely store secret on a device, either using a password, or using biometrics.

📚 [API Documentation](https://pub.dev/documentation/secure_store/latest/)
| | PasswordStore | BiometricsStore |
| ------- | ------------- | --------------- |
| IOS |||
Expand Down
109 changes: 38 additions & 71 deletions docs/packages/starknet-provider.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# 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 |
| Feature | State | Version |
| -------------- | ----- | ------- |
| invoke || 0, 1, 3 |
| declare || 1, 2, 3 |
| deploy_account || 1, 3 |

## Supported JSON RPC methods

Expand All @@ -19,81 +18,49 @@ A Dart package for interacting with Starknet node using JSON-RPC, following the
### 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 ||

| 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 ||

| Name | Implemented |
| ------------------------------------ | ----------- |
| starknet_addInvokeTransaction ||
| starknet_addDeclareTransaction ||
| starknet_addDeployAccountTransaction ||

## Usage
### Call read-only method

```dart
import 'package:starknet/starknet.dart';
void main() async {
final provider = JsonRpcProvider.infuraGoerliTestnet;
final accountAddress = Felt.fromHexString(
'0x046a1aa85bb0e68cd29fadbc81791208ddebee17886f075935e5b72f4aa898aa');
final ethContractAddress = Felt.fromHexString(
'0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7');
final ethDecimals = 18;
final response = await provider.call(
request: FunctionCall(
contractAddress: ethContractAddress,
entryPointSelector: getSelectorByName('balanceOf'),
calldata: [accountAddress],
),
blockId: BlockId.blockTag("latest"),
);
response.when(
error: (error) {
throw Exception(error);
},
result: (result) {
final ethBalance = Uint256.fromFeltList(result).toBigInt() /
BigInt.from(10).pow(ethDecimals);
print("ETH balance: ${ethBalance}"); // ETH balance: 8.142616847371661
},
);
}
```
1 change: 1 addition & 0 deletions docs/packages/starknet.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Starknet Package
📚 [API Documentation](https://pub.dev/documentation/starknet/latest/)
1 change: 1 addition & 0 deletions docs/packages/wallet-kit.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Wallet Kit Package
📚 [API Documentation](https://pub.dev/documentation/wallet_kit/latest/)
2 changes: 1 addition & 1 deletion packages/secure_store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Change your `MainActivity` to extend `FlutterFragmentActivity` instead of `Flutt
```kt
package com.example.example

import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
}
Expand Down

0 comments on commit fab8cd5

Please sign in to comment.