Skip to content

Commit 8374ecd

Browse files
Copilot0xrinegade
andcommitted
Implement comprehensive Flutter SDK for svm-pay
Co-authored-by: 0xrinegade <[email protected]>
1 parent 903c8b9 commit 8374ecd

File tree

93 files changed

+4413
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4413
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ SVM-Pay is a payment solution for SVM networks (Solana, Sonic SVM, Eclipse, s00n
1717
- **C++ SDK**: Native C++ SDK for high-performance applications and system integration
1818
- **Assembly-BPF SDK**: Low-level BPF program development with Assembly and LLVM IR abstractions
1919
- **Mobile Support**: iOS and Android SDK for mobile applications
20+
- **Flutter SDK**: Cross-platform mobile development with Flutter
2021
- **No Fees**: SVM-Pay itself charges no fees (only standard network transaction fees apply)
2122
- **Secure**: Built with security best practices for blockchain payments
2223
- **Flexible**: Support for different payment scenarios (e-commerce, point-of-sale, subscriptions)
@@ -29,6 +30,7 @@ SVM-Pay is a payment solution for SVM networks (Solana, Sonic SVM, Eclipse, s00n
2930
- [Architecture](docs/architecture.md)
3031
- [Security Recommendations](docs/security-recommendations.md)
3132
- [C++ SDK](cpp-sdk/README.md)
33+
- [Flutter SDK](flutter_sdk/README.md)
3234
- [Examples](examples/)
3335
- [CLI Integration](CLI-INTEGRATION.md)
3436

@@ -232,6 +234,52 @@ std::string ref = client.generate_reference();
232234
233235
See [C++ SDK Documentation](cpp-sdk/README.md) for detailed installation and usage instructions.
234236
237+
## Flutter SDK
238+
239+
SVM-Pay includes a comprehensive Flutter SDK for cross-platform mobile development:
240+
241+
```dart
242+
import 'package:svm_pay/svm_pay.dart';
243+
244+
// Initialize SDK
245+
final svmPay = SVMPay(
246+
config: const SVMPayConfig(
247+
defaultNetwork: SVMNetwork.solana,
248+
debug: true,
249+
),
250+
);
251+
252+
// Create payment URL
253+
final url = svmPay.createTransferUrl(
254+
'recipient_address',
255+
'1.5',
256+
label: 'Coffee Shop',
257+
message: 'Payment for coffee',
258+
);
259+
260+
// Use payment widgets
261+
PaymentButton(
262+
recipient: 'recipient_address',
263+
amount: '1.0',
264+
label: 'Pay 1.0 SOL',
265+
onPayment: (result) async {
266+
if (result.status == PaymentStatus.confirmed) {
267+
print('Payment successful!');
268+
}
269+
},
270+
)
271+
```
272+
273+
**Features:**
274+
- Cross-platform support (iOS & Android)
275+
- Pre-built payment widgets (buttons, forms, QR codes)
276+
- Type-safe Dart API with comprehensive error handling
277+
- Platform channels for native performance
278+
- Support for all SVM networks
279+
- Payment URL generation and parsing
280+
281+
See [Flutter SDK Documentation](flutter_sdk/README.md) for detailed installation and usage instructions.
282+
235283
## Demo Applications
236284

237285
SVM-Pay includes several demo applications to showcase its functionality:

flutter_sdk/.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.build/
9+
.buildlog/
10+
.history
11+
.svn/
12+
.swiftpm/
13+
migrate_working_dir/
14+
15+
# IntelliJ related
16+
*.iml
17+
*.ipr
18+
*.iws
19+
.idea/
20+
21+
# The .vscode folder contains launch configuration and tasks you configure in
22+
# VS Code which you may wish to be included in version control, so this line
23+
# is commented out by default.
24+
#.vscode/
25+
26+
# Flutter/Dart/Pub related
27+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
28+
/pubspec.lock
29+
**/doc/api/
30+
.dart_tool/
31+
.flutter-plugins
32+
.flutter-plugins-dependencies
33+
build/

flutter_sdk/.metadata

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "edada7c56edf4a183c1735310e123c7f923584f1"
8+
channel: "stable"
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: edada7c56edf4a183c1735310e123c7f923584f1
17+
base_revision: edada7c56edf4a183c1735310e123c7f923584f1
18+
- platform: android
19+
create_revision: edada7c56edf4a183c1735310e123c7f923584f1
20+
base_revision: edada7c56edf4a183c1735310e123c7f923584f1
21+
- platform: ios
22+
create_revision: edada7c56edf4a183c1735310e123c7f923584f1
23+
base_revision: edada7c56edf4a183c1735310e123c7f923584f1
24+
25+
# User provided section
26+
27+
# List of Local paths (relative to this file) that should be
28+
# ignored by the migrate tool.
29+
#
30+
# Files that are not part of the templates will be ignored by default.
31+
unmanaged_files:
32+
- 'lib/main.dart'
33+
- 'ios/Runner.xcodeproj/project.pbxproj'

flutter_sdk/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

flutter_sdk/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TODO: Add your license here.

0 commit comments

Comments
 (0)