-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a694a50
commit 60c8b05
Showing
4 changed files
with
639 additions
and
632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
# 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 | ✅ | | ||
|
||
### 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 | ✅ | | ||
|
||
### Call read-only method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
## AVNU Paymaster | ||
|
||
AVNU Paymaster i a Dart package that provides a way to interact with the [AVNU paymaster service](https://doc.avnu.fi/avnu-paymaster/overview). | ||
## AVNU Paymaster | ||
|
||
AVNU Paymaster i a Dart package that provides a way to interact with the [AVNU paymaster service](https://doc.avnu.fi/avnu-paymaster/overview). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,104 @@ | ||
# 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 | | ||
| ------- | ------------- | --------------- | | ||
| IOS | ✅ | ✅ | | ||
| Android | ✅ | ✅ | | ||
| Web | ✅ | ❌ | | ||
| Mac | ✅ | ✅ | | ||
| Windows | ✅ | ❌ | | ||
| Linux | ✅ | ❌ | | ||
|
||
## Usage | ||
|
||
### Biometrics Store | ||
|
||
```dart | ||
await BiometricStore().storeSecret( | ||
secret: "Simplicity is the ultimate sophistication", | ||
key: "biometrics-store:secret", | ||
); | ||
final secret = await BiometricStore().getSecret( | ||
key: "biometrics-store:secret", | ||
); | ||
await BiometricStore().deleteSecret( | ||
key: "biometrics-store:secret", | ||
); | ||
``` | ||
|
||
### Password Store | ||
|
||
First you need to initialize the password store since it's using Hive under the hood. | ||
|
||
```dart | ||
// In main.dart | ||
void main() { | ||
PasswordStore.init(); | ||
runApp(const MyApp()); | ||
} | ||
``` | ||
|
||
Then you can use password store very easily: | ||
|
||
```dart | ||
await PasswordStore().storeSecret( | ||
secret: "Simplicity is the ultimate sophistication", | ||
key: "password-store:secret", | ||
options: const PasswordStoreOptions(password: "1234"), | ||
); | ||
final secret = await PasswordStore().getSecret( | ||
key: "password-store:secret", | ||
options: const PasswordStoreOptions(password: "1234"), | ||
); | ||
``` | ||
|
||
## Platform Setup | ||
|
||
### IOS | ||
|
||
Add `NSFaceIDUsageDescription` permission in `Info.plist`: | ||
|
||
```plist | ||
<key>NSFaceIDUsageDescription</key> | ||
<string>Use Touch ID or Face ID to process transactions.</string> | ||
``` | ||
|
||
### Android | ||
|
||
Edit your `android/app/build.gradle`: | ||
|
||
```gradle | ||
android { | ||
defaultConfig { | ||
minSdkVersion 23 | ||
} | ||
} | ||
``` | ||
|
||
import io.flutter.embedding.android.FlutterFragmentActivity | ||
|
||
class MainActivity: FlutterFragmentActivity() { | ||
} | ||
|
||
### Mac | ||
|
||
You need to add the Keychain Sharing capability in the Xcode project [following this guide](https://developer.apple.com/documentation/xcode/configuring-keychain-sharing). | ||
|
||
NOTE: you only need to add the capability, it's not needed to add any Keychain Groups. | ||
|
||
## Security Overview | ||
|
||
Some platforms and devices might be more secure than others. On iOS & MacOS, this plugin uses the [Secure Enclave](https://support.apple.com/fr-ca/guide/security/sec59b0b31ff/web) to protect the private key (if the device do not have a biometric component or not enabled, a password will be asked to encrypt data as a fallback method). On Android, the plugin biometric_storage is used. When biometric authentication is available, it is used to protect the private key. On other platforms and when the above is not available, the private key is encrypted using a password and stored in shared preferences. | ||
|
||
Here's an in-depth [architecture overview](https://focustree.notion.site/Seed-phrase-storage-cfafbd43f8b04b738dd66804459455fa?pvs=25). | ||
# 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 | | ||
| ------- | ------------- | --------------- | | ||
| IOS | ✅ | ✅ | | ||
| Android | ✅ | ✅ | | ||
| Web | ✅ | ❌ | | ||
| Mac | ✅ | ✅ | | ||
| Windows | ✅ | ❌ | | ||
| Linux | ✅ | ❌ | | ||
|
||
## Usage | ||
|
||
### Biometrics Store | ||
|
||
```dart | ||
await BiometricStore().storeSecret( | ||
secret: "Simplicity is the ultimate sophistication", | ||
key: "biometrics-store:secret", | ||
); | ||
final secret = await BiometricStore().getSecret( | ||
key: "biometrics-store:secret", | ||
); | ||
await BiometricStore().deleteSecret( | ||
key: "biometrics-store:secret", | ||
); | ||
``` | ||
|
||
### Password Store | ||
|
||
First you need to initialize the password store since it's using Hive under the hood. | ||
|
||
```dart | ||
// In main.dart | ||
void main() { | ||
PasswordStore.init(); | ||
runApp(const MyApp()); | ||
} | ||
``` | ||
|
||
Then you can use password store very easily: | ||
|
||
```dart | ||
await PasswordStore().storeSecret( | ||
secret: "Simplicity is the ultimate sophistication", | ||
key: "password-store:secret", | ||
options: const PasswordStoreOptions(password: "1234"), | ||
); | ||
final secret = await PasswordStore().getSecret( | ||
key: "password-store:secret", | ||
options: const PasswordStoreOptions(password: "1234"), | ||
); | ||
``` | ||
|
||
## Platform Setup | ||
|
||
### IOS | ||
|
||
Add `NSFaceIDUsageDescription` permission in `Info.plist`: | ||
|
||
```plist | ||
<key>NSFaceIDUsageDescription</key> | ||
<string>Use Touch ID or Face ID to process transactions.</string> | ||
``` | ||
|
||
### Android | ||
|
||
Edit your `android/app/build.gradle`: | ||
|
||
```gradle | ||
android { | ||
defaultConfig { | ||
minSdkVersion 23 | ||
} | ||
} | ||
``` | ||
|
||
Change your `MainActivity` to extend `FlutterFragmentActivity` instead of `FlutterActivity`: | ||
|
||
```kt | ||
package com.example.example | ||
|
||
import io.flutter.embedding.android.FlutterFragmentActivity | ||
|
||
class MainActivity: FlutterFragmentActivity() { | ||
} | ||
``` | ||
|
||
### Mac | ||
|
||
You need to add the Keychain Sharing capability in the Xcode project [following this guide](https://developer.apple.com/documentation/xcode/configuring-keychain-sharing). | ||
|
||
NOTE: you only need to add the capability, it's not needed to add any Keychain Groups. | ||
|
||
## Security Overview | ||
|
||
Some platforms and devices might be more secure than others. On iOS & MacOS, this plugin uses the [Secure Enclave](https://support.apple.com/fr-ca/guide/security/sec59b0b31ff/web) to protect the private key (if the device do not have a biometric component or not enabled, a password will be asked to encrypt data as a fallback method). On Android, the plugin biometric_storage is used. When biometric authentication is available, it is used to protect the private key. On other platforms and when the above is not available, the private key is encrypted using a password and stored in shared preferences. | ||
|
||
Here's an in-depth [architecture overview](https://focustree.notion.site/Seed-phrase-storage-cfafbd43f8b04b738dd66804459455fa?pvs=25). |
Oops, something went wrong.