Skip to content
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

docs(documentation): Add API documentation links to package docs #461

Merged
merged 13 commits into from
Mar 3, 2025
Merged
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
102 changes: 68 additions & 34 deletions docs/packages/starknet-provider.mdx
Original file line number Diff line number Diff line change
@@ -1,34 +1,68 @@
# 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
},
);
}
```
# Call read-only method
📚 [API Documentation](https://pub.dev/documentation/starknet_provider/latest/)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these lines comes from a bad merge conflict resolution, could you please remove these lines

# 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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep the call read-only snippet of code

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/)
8 changes: 8 additions & 0 deletions packages/avnu_provider/README.md
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep original encoding.

Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@

AVNU Paymaster i a Dart package that provides a way to interact with the [AVNU paymaster service](https://doc.avnu.fi/avnu-paymaster/overview).









Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove these blank lines

1 change: 0 additions & 1 deletion packages/secure_store/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# secure_store

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

| | PasswordStore | BiometricsStore |
Expand Down
1 change: 0 additions & 1 deletion packages/wallet_kit/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# secure_store

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep this blank line

A package to ease the use of [starknet](https://pub.dev/packages/starknet) in your Flutter app.

## Dart setup
Expand Down