├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ ├── Podfile.lock │ └── Podfile ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── pylons │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── test │ └── widget_test.dart └── analysis_options.yaml ├── LICENSE ├── lib ├── src │ ├── features │ │ ├── ipc │ │ │ ├── base │ │ │ │ └── ipc_handler.dart │ │ │ ├── ipc_constants.dart │ │ │ ├── handlers │ │ │ │ ├── get_cookbooks_handler.dart │ │ │ │ ├── get_trades_handler.dart │ │ │ │ ├── get_recipes_handler.dart │ │ │ │ ├── get_item_by_id_handler.dart │ │ │ │ ├── get_recipe_handler.dart │ │ │ │ ├── get_execution_by_id_handler.dart │ │ │ │ ├── get_profile_handler.dart │ │ │ │ ├── get_list_items_by_owner_handler.dart │ │ │ │ └── get_execution_by_recipe_handler.dart │ │ │ ├── responseCompleters.dart │ │ │ └── ipc_handler_factory.dart │ │ ├── helper │ │ │ └── dec_string.dart │ │ ├── models │ │ │ ├── sdk_ipc_message.dart │ │ │ ├── sdk_ipc_response.dart │ │ │ └── execution_list_by_recipe_response.dart │ │ └── validations │ │ │ └── validate_recipe.dart │ └── generated │ │ ├── pylons │ │ ├── item.pbenum.dart │ │ ├── tx.pbenum.dart │ │ ├── event.pbenum.dart │ │ ├── params.pbenum.dart │ │ ├── query.pbenum.dart │ │ ├── recipe.pbenum.dart │ │ ├── trade.pbenum.dart │ │ ├── accounts.pbenum.dart │ │ ├── cookbook.pbenum.dart │ │ ├── execution.pbenum.dart │ │ ├── genesis.pbenum.dart │ │ ├── history.pbenum.dart │ │ ├── redeem_info.pbenum.dart │ │ ├── payment_info.pbenum.dart │ │ ├── standard_error.pbenum.dart │ │ ├── stripe_refund.pbenum.dart │ │ ├── google_iap_order.pbenum.dart │ │ ├── apple_in_app_purchase_order.pbenum.dart │ │ ├── standard_error.pbjson.dart │ │ ├── stripe_refund.pbjson.dart │ │ ├── history.pbjson.dart │ │ ├── apple_in_app_purchase_order.pbjson.dart │ │ ├── google_iap_order.pbjson.dart │ │ ├── payment_info.pbjson.dart │ │ ├── cookbook.pbjson.dart │ │ ├── accounts.pbjson.dart │ │ └── redeem_info.pbjson.dart │ │ ├── google │ │ └── protobuf │ │ │ ├── any.pbenum.dart │ │ │ ├── duration.pbenum.dart │ │ │ ├── timestamp.pbenum.dart │ │ │ ├── any.pbserver.dart │ │ │ ├── duration.pbserver.dart │ │ │ ├── timestamp.pbserver.dart │ │ │ ├── any.pbjson.dart │ │ │ ├── duration.pbjson.dart │ │ │ └── timestamp.pbjson.dart │ │ ├── cosmos │ │ ├── tx │ │ │ ├── v1beta1 │ │ │ │ ├── tx.pbenum.dart │ │ │ │ ├── tx.pbserver.dart │ │ │ │ ├── service.pbserver.dart │ │ │ │ └── service.pbenum.dart │ │ │ └── signing │ │ │ │ └── v1beta1 │ │ │ │ ├── signing.pbserver.dart │ │ │ │ └── signing.pbenum.dart │ │ ├── auth │ │ │ └── v1beta1 │ │ │ │ ├── auth.pbenum.dart │ │ │ │ ├── genesis.pbenum.dart │ │ │ │ ├── query.pbenum.dart │ │ │ │ ├── auth.pbserver.dart │ │ │ │ ├── genesis.pbserver.dart │ │ │ │ ├── genesis.pbjson.dart │ │ │ │ └── query.pbserver.dart │ │ ├── authz │ │ │ └── v1beta1 │ │ │ │ ├── tx.pbenum.dart │ │ │ │ ├── authz.pbenum.dart │ │ │ │ ├── event.pbenum.dart │ │ │ │ ├── query.pbenum.dart │ │ │ │ ├── genesis.pbenum.dart │ │ │ │ ├── authz.pbserver.dart │ │ │ │ ├── event.pbserver.dart │ │ │ │ ├── genesis.pbserver.dart │ │ │ │ ├── query.pbserver.dart │ │ │ │ ├── event.pbjson.dart │ │ │ │ ├── authz.pbjson.dart │ │ │ │ ├── tx.pbserver.dart │ │ │ │ └── genesis.pbjson.dart │ │ ├── base │ │ │ ├── v1beta1 │ │ │ │ ├── coin.pbenum.dart │ │ │ │ ├── coin.pbserver.dart │ │ │ │ └── coin.pbjson.dart │ │ │ ├── abci │ │ │ │ └── v1beta1 │ │ │ │ │ ├── abci.pbenum.dart │ │ │ │ │ └── abci.pbserver.dart │ │ │ └── query │ │ │ │ └── v1beta1 │ │ │ │ ├── pagination.pbenum.dart │ │ │ │ ├── pagination.pbserver.dart │ │ │ │ └── pagination.pbjson.dart │ │ └── crypto │ │ │ ├── ed25519 │ │ │ ├── keys.pbenum.dart │ │ │ ├── keys.pbserver.dart │ │ │ └── keys.pbjson.dart │ │ │ ├── secp256k1 │ │ │ ├── keys.pbenum.dart │ │ │ ├── keys.pbserver.dart │ │ │ └── keys.pbjson.dart │ │ │ ├── secp256r1 │ │ │ ├── keys.pbenum.dart │ │ │ ├── keys.pbserver.dart │ │ │ └── keys.pbjson.dart │ │ │ └── multisig │ │ │ └── v1beta1 │ │ │ ├── multisig.pbenum.dart │ │ │ ├── multisig.pbserver.dart │ │ │ └── multisig.pbjson.dart │ │ └── tendermint │ │ ├── crypto │ │ ├── keys.pbenum.dart │ │ ├── proof.pbenum.dart │ │ ├── keys.pbserver.dart │ │ ├── proof.pbserver.dart │ │ └── keys.pbjson.dart │ │ ├── types │ │ ├── params.pbenum.dart │ │ ├── validator.pbenum.dart │ │ ├── types.pbserver.dart │ │ ├── params.pbserver.dart │ │ ├── validator.pbserver.dart │ │ └── types.pbenum.dart │ │ └── version │ │ ├── types.pbenum.dart │ │ ├── types.pbserver.dart │ │ └── types.pbjson.dart └── pylons_sdk.dart ├── test ├── src │ └── features │ │ ├── data │ │ └── models │ │ │ ├── trade_test.dart │ │ │ ├── item_test.dart │ │ │ └── recipe_test.dart │ │ ├── models │ │ ├── ipc_message_test.dart │ │ └── ipc_response_test.dart │ │ ├── helper │ │ └── dec_string_test.dart │ │ ├── ipc │ │ ├── handlers │ │ │ ├── get_cookbook_handler_test.dart │ │ │ ├── get_profile_hander_test.dart │ │ │ ├── get_item_by_id_handler_test.dart │ │ │ ├── get_execution_by_id_handler_test.dart │ │ │ ├── get_items_by_owner_test.dart │ │ │ ├── get_execution_by_recipe_handler_test.dart │ │ │ ├── get_recipe_handler_test.dart │ │ │ ├── get_trades_handler_test.dart │ │ │ └── get_recipes_handler_test.dart │ │ └── ipc_handler_factory_test.dart │ │ └── core │ │ └── error │ │ └── exception_test.dart ├── mocks │ ├── mockedWallet.dart │ └── mock_uni_link.dart └── helper │ └── test_util.dart ├── scripts └── test_coverage.sh ├── test_resources ├── cookbook │ ├── cb1.json │ ├── cb2.json │ ├── cb3.json │ └── cookbook_from_node.json ├── trade │ └── trade_from_node.json ├── trades │ ├── trade1.json │ ├── trade2.json │ └── trade3.json └── recipe │ ├── rcp1.json │ ├── rcp3.json │ ├── rcp2.json │ └── recipe_from_node.json ├── .metadata ├── .vscode └── launch.json ├── doc ├── spec │ └── README.md └── 02_cookbooks.md ├── pubspec.yaml ├── .github ├── workflows │ └── dart.yml └── .workflows │ └── github_actions.yml ├── CHANGELOG.md ├── analysis_options.yaml └── .gitignore /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This code is licensed for use developing and deploying apps for the Pylons wallet and blockchain. 2 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /lib/src/features/ipc/base/ipc_handler.dart: -------------------------------------------------------------------------------- 1 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 2 | 3 | abstract class IPCHandler { 4 | void handler(SDKIPCResponse response); 5 | } 6 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /lib/src/features/ipc/ipc_constants.dart: -------------------------------------------------------------------------------- 1 | const String EXISTS_CONSTANT = 'pylons://wallet/exists'; 2 | const String BASE_UNI_LINK = 'pylons://wallet'; 3 | const String BASE_UNI_LINK_IOS = 'pylons-wallet://'; 4 | -------------------------------------------------------------------------------- /test/src/features/data/models/trade_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | testWidgets('trade ...', (tester) async { 5 | // TODO: Implement test 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Pylons-tech/pylons_dart_sdk/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/pylons/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.pylons.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /scripts/test_coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | arch -x86_64 flutter test --coverage 3 | lcov --remove coverage/lcov.info 'lib/src/generated/*' -o coverage/new_lcov.info 4 | genhtml coverage/new_lcov.info -o coverage/html 5 | open coverage/html/index.html 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test_resources/cookbook/cb1.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodeVersion": "1.0", 3 | "id": "notARealCookbook001", 4 | "name": "notARealCookbook001", 5 | "description": "notARealCookbook001", 6 | "version": "1.0", 7 | "developer": "n/a", 8 | "sender": "", 9 | "supportEmail": "example@example.com", 10 | "costPerBlock": 1 11 | } 12 | -------------------------------------------------------------------------------- /test_resources/cookbook/cb2.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodeVersion" : "1.0", 3 | "id" : "notARealCookbook002", 4 | "name" : "notARealCookbook002", 5 | "description" : "notARealCookbook002", 6 | "version" : "1.0", 7 | "developer" : "n/a", 8 | "sender" : "", 9 | "supportEmail" : "example@example.com", 10 | "costPerBlock" : 1 11 | } -------------------------------------------------------------------------------- /test_resources/cookbook/cb3.json: -------------------------------------------------------------------------------- 1 | { 2 | "nodeVersion" : "1.0", 3 | "id" : "notARealCookbook003", 4 | "name" : "notARealCookbook003", 5 | "description" : "notARealCookbook003", 6 | "version" : "1.0", 7 | "developer" : "n/a", 8 | "sender" : "", 9 | "supportEmail" : "example@example.com", 10 | "costPerBlock" : 1 11 | } -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 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: 4cc385b4b84ac2f816d939a49ea1f328c4e0b48e 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 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: ffb2ecea5223acdd139a5039be2f9c796962833d 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/item.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/item.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/tx.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/tx.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/event.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/event.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/params.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/params.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/query.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/query.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/recipe.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/recipe.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/trade.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/trade.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/any.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/any.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/accounts.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/accounts.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/cookbook.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/cookbook.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/execution.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/execution.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/genesis.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/history.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/history.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/v1beta1/tx.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/v1beta1/tx.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/redeem_info.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/redeem_info.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/crypto/keys.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/crypto/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/auth.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/auth.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/tx.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/tx.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/v1beta1/coin.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/v1beta1/coin.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/duration.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/payment_info.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/payment_info.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/standard_error.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/standard_error.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/stripe_refund.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/stripe_refund.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/crypto/proof.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/crypto/proof.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/params.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/params.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/version/types.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/version/types.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/genesis.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/query.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/query.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/authz.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/authz.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/event.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/event.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/query.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/query.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/ed25519/keys.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/ed25519/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/timestamp.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/google_iap_order.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/google_iap_order.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/validator.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/validator.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/genesis.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/abci/v1beta1/abci.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/abci/v1beta1/abci.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256k1/keys.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256k1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256r1/keys.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256r1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/query/v1beta1/pagination.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/query/v1beta1/pagination.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/multisig/v1beta1/multisig.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/multisig/v1beta1/multisig.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/apple_in_app_purchase_order.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/apple_in_app_purchase_order.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/v1beta1/tx.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/v1beta1/tx.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'tx.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/any.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/any.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'any.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/crypto/keys.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/crypto/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'keys.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/types.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/types.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'types.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/auth.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/auth.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'auth.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/v1beta1/coin.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/v1beta1/coin.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'coin.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/crypto/proof.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/crypto/proof.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'proof.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/params.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/params.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'params.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/version/types.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/version/types.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'types.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/authz.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/authz.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'authz.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/event.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/event.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'event.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/ed25519/keys.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/ed25519/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'keys.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/duration.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'duration.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/timestamp.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'timestamp.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/genesis.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'genesis.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/genesis.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'genesis.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/abci/v1beta1/abci.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/abci/v1beta1/abci.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'abci.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256k1/keys.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256k1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'keys.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256r1/keys.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256r1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'keys.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/validator.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/validator.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'validator.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/signing/v1beta1/signing.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/signing/v1beta1/signing.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'signing.pb.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/query/v1beta1/pagination.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/query/v1beta1/pagination.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'pagination.pb.dart'; 9 | -------------------------------------------------------------------------------- /test_resources/cookbook/cookbook_from_node.json: -------------------------------------------------------------------------------- 1 | { 2 | "creator": "pylo1akzpu26f36pgxr636uch8evdtdjepu93v5y9s2", 3 | "ID": "cookbookLOUD", 4 | "name": "Legend of the Undead Dragon", 5 | "nodeVersion": "v0.1.3", 6 | "description": "Cookbook for running pylons recreation of LOUD", 7 | "developer": "Pylons Inc", 8 | "version": "v0.0.1", 9 | "supportEmail": "alex@shmeeload.xyz", 10 | "costPerBlock": {"denom": "upylon", "amount": "1000000"}, 11 | "enabled": true 12 | } -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/multisig/v1beta1/multisig.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/multisig/v1beta1/multisig.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | export 'multisig.pb.dart'; 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /test_resources/trade/trade_from_node.json: -------------------------------------------------------------------------------- 1 | { 2 | "creator": "pylo15skmjtnajjg65f30r9ujjz4yfzs9we8zv7uksh", 3 | "coinInputs": [ 4 | { 5 | "coins": [ 6 | { 7 | "denom": "testCookbookID/testCoin", 8 | "amount": "110" 9 | } 10 | ] 11 | } 12 | ], 13 | "itemInputs": [], 14 | "coinOutputs": [], 15 | "itemOutputs": [ 16 | { 17 | "cookbookID": "testCookbookID", 18 | "itemID": "11111111" 19 | } 20 | ], 21 | "extraInfo": "extraInfo", 22 | "tradedItemInputs": [] 23 | } -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /test/mocks/mockedWallet.dart: -------------------------------------------------------------------------------- 1 | import 'package:mockito/mockito.dart'; 2 | import 'package:pylons_sdk/pylons_sdk.dart'; 3 | 4 | class MockWallet extends Mock implements PylonsWallet { 5 | List cookbooks = []; 6 | List recipes = []; 7 | List trades = []; 8 | 9 | /// Load the provided cookbooks. We'll use these to mock getCookbooks. 10 | void loadCookbooks(List cbs) { 11 | cookbooks.addAll(cbs); 12 | } 13 | 14 | void loadRecipes(List rcps) { 15 | recipes.addAll(rcps); 16 | } 17 | 18 | void loadTrades(List trade) { 19 | trades.addAll(trade); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "pylons_flutter", 9 | "cwd": "pylons_flutter", 10 | "request": "launch", 11 | "type": "dart" 12 | }, 13 | { 14 | "name": "pylons_flutter (profile mode)", 15 | "cwd": "pylons_flutter", 16 | "request": "launch", 17 | "type": "dart", 18 | "flutterMode": "profile" 19 | } 20 | ] 21 | } -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/ephemeral/ 22 | Flutter/app.flx 23 | Flutter/app.zip 24 | Flutter/flutter_assets/ 25 | Flutter/flutter_export_environment.sh 26 | ServiceDefinitions.json 27 | Runner/GeneratedPluginRegistrant.* 28 | 29 | # Exceptions to above rules. 30 | !default.mode1v3 31 | !default.mode2v3 32 | !default.pbxuser 33 | !default.perspectivev3 34 | -------------------------------------------------------------------------------- /doc/spec/README.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | # `pylons_flutter` 9 | 10 | Pylons is the flagship NFT chain in the Cosmos ecosystem. Built on the Cosmos SDK, Pylons is a fast and interoperable system for brands and creators to build engaging products with meaningful NFT experiences. 11 | 12 | Pylons is the fastest, easiest way to launch a massive NFT product with minimal transaction fees. 13 | 14 | ## Abstract 15 | 16 | This document specifies the `pylons_sdk` module for the Pylons NFT blockchain. 17 | 18 | ## Contents 19 | 20 | 1. **[Getting Started with Pylons SDK in Flutter](01_getting_started_flutter.md)** 21 | 2. **[Cookbooks](02_cookbooks.md)** 22 | 3. **[Recipes](03_recipes.md)** 23 | 4. **[Queries](02_transactions.md)** 24 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - uni_links (0.0.1): 4 | - Flutter 5 | - url_launcher (0.0.1): 6 | - Flutter 7 | 8 | DEPENDENCIES: 9 | - Flutter (from `Flutter`) 10 | - uni_links (from `.symlinks/plugins/uni_links/ios`) 11 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) 12 | 13 | EXTERNAL SOURCES: 14 | Flutter: 15 | :path: Flutter 16 | uni_links: 17 | :path: ".symlinks/plugins/uni_links/ios" 18 | url_launcher: 19 | :path: ".symlinks/plugins/url_launcher/ios" 20 | 21 | SPEC CHECKSUMS: 22 | Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a 23 | uni_links: d97da20c7701486ba192624d99bffaaffcfc298a 24 | url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649 25 | 26 | PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c 27 | 28 | COCOAPODS: 1.10.1 29 | -------------------------------------------------------------------------------- /lib/pylons_sdk.dart: -------------------------------------------------------------------------------- 1 | /// Library providing tools for writing client applications that interact with 2 | /// the Pylons blockchain through an IPC connection with a wallet app in 3 | /// Flutter. 4 | library pylons_sdk; 5 | 6 | export 'src/core/error/exceptions.dart'; 7 | export 'src/features/data/models/profile.dart' show Profile; 8 | export 'src/pylons_wallet.dart'; 9 | export 'src/generated/pylons/tx.pb.dart'; 10 | export 'src/generated/cosmos/tx/v1beta1/tx.pb.dart'; 11 | export 'src/generated/pylons/item.pb.dart'; 12 | export 'src/generated/pylons/cookbook.pb.dart'; 13 | export 'src/generated/pylons/recipe.pb.dart'; 14 | export 'src/generated/pylons/trade.pb.dart'; 15 | export 'src/features/helper/dec_string.dart'; 16 | export 'src/generated/cosmos/base/v1beta1/coin.pb.dart' show Coin; 17 | export 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 18 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: pylons_sdk 2 | description: Pylons sdk connects client apps to the pylons wallet. It helps the client apps to perform actions on the pylons chain via wallet. 3 | version: 0.1.3 4 | homepage: https://www.pylons.tech/ 5 | repository: https://github.com/Pylons-tech/pylons_dart_sdk 6 | 7 | environment: 8 | sdk: ">=2.14.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dartz: ^0.10.0 15 | equatable: ^2.0.3 16 | 17 | decimal: ^2.1.0 18 | 19 | 20 | #Used it for ipc 21 | uni_links: ^0.5.1 22 | uni_links_platform_interface: ^1.0.0 23 | 24 | 25 | url_launcher: ^6.1.2 26 | protobuf: ^2.0.0 27 | 28 | fixnum: ^1.0.0 29 | 30 | bitstream: ^0.0.4 31 | 32 | dev_dependencies: 33 | flutter_test: 34 | sdk: flutter 35 | 36 | mockito: ^5.0.16 37 | 38 | # code_builder: ^4.0.0 39 | build_runner: ^2.1.4 40 | 41 | 42 | 43 | 44 | flutter: 45 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /test/src/features/models/ipc_message_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 3 | import 'package:pylons_sdk/src/features/models/sdk_ipc_message.dart'; 4 | 5 | import '../../../mocks/mock_constants.dart'; 6 | 7 | void main() { 8 | test('should give SDKIPCMessage from Json', () { 9 | const message = 10 | 'ewoJImFjdGlvbiI6ICJnZXRQcm9maWxlIiwKCSJqc29uIjogIkphd2FkIiwKCSJyZXF1ZXN0X3Jlc3BvbnNlIiA6IHRydWUsCgkic2VuZGVyIjogImV4YW1wbGUiCgp9'; 11 | 12 | final sdkMessage = SDKIPCMessage.fromIPCMessage(message); 13 | expect(Strings.GET_PROFILE, sdkMessage.action); 14 | expect(MOCK_USERNAME, sdkMessage.json); 15 | expect(MOCK_HOST, sdkMessage.sender); 16 | print(sdkMessage.toString()); 17 | expect( 18 | 'SDKIPCMessage{action: ${Strings.GET_PROFILE}, json: $MOCK_USERNAME, sender: $MOCK_HOST, requestResponse: ${true}}', 19 | sdkMessage.toString()); 20 | }); 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/dart.yml: -------------------------------------------------------------------------------- 1 | # This workflow uses actions that are not certified by GitHub. 2 | # They are provided by a third-party and are governed by 3 | # separate terms of service, privacy policy, and support 4 | # documentation. 5 | 6 | name: Dart 7 | on: 8 | push: 9 | branches: [ main ] 10 | pull_request: 11 | branches: [ main ] 12 | jobs: 13 | test: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Set up Repository 17 | uses: actions/checkout@v2 18 | - name: Set up Dart 19 | uses: dart-lang/setup-dart@v1 20 | - uses: subosito/flutter-action@v1 21 | with: 22 | channel: 'stable' # 'dev', 'alpha', default to: 'stable' 23 | - name: Verify Formatting 24 | run: flutter format --output=none --set-exit-if-changed . 25 | - name: Install Pub Dependencies 26 | run: flutter pub get 27 | - name: Analyze Project Source 28 | run: dart analyze 29 | - name: Flutter test 30 | run: flutter test --coverage 31 | 32 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/any.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/any.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use anyDescriptor instead') 13 | const Any$json = const { 14 | '1': 'Any', 15 | '2': const [ 16 | const {'1': 'type_url', '3': 1, '4': 1, '5': 9, '10': 'typeUrl'}, 17 | const {'1': 'value', '3': 2, '4': 1, '5': 12, '10': 'value'}, 18 | ], 19 | }; 20 | 21 | /// Descriptor for `Any`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List anyDescriptor = $convert.base64Decode( 23 | 'CgNBbnkSGQoIdHlwZV91cmwYASABKAlSB3R5cGVVcmwSFAoFdmFsdWUYAiABKAxSBXZhbHVl'); 24 | -------------------------------------------------------------------------------- /test/src/features/helper/dec_string_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/src/features/helper/dec_string.dart'; 3 | 4 | void main() { 5 | test('string to dec', () { 6 | expect(1, DecString.doubleFromDecString('100000000000000000')); 7 | expect(0.1, DecString.doubleFromDecString('10000000000000000')); 8 | expect(0.01, DecString.doubleFromDecString('1000000000000000')); 9 | expect(0.00000000000000001, DecString.doubleFromDecString('1')); 10 | }); 11 | test('dec to string', () { 12 | expect('100000000000000000', DecString.decStringFromDouble(1)); 13 | expect('10000000000000000', DecString.decStringFromDouble(0.1)); 14 | expect('1000000000000000', DecString.decStringFromDouble(0.01)); 15 | expect('1', DecString.decStringFromDouble(0.00000000000000001)); 16 | }); 17 | 18 | test('should throw error when amount is greater than Max', () { 19 | expect(() => DecString.doubleFromDecString('9999999999999999999'), 20 | throwsA(isA())); 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/duration.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/duration.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use durationDescriptor instead') 13 | const Duration$json = const { 14 | '1': 'Duration', 15 | '2': const [ 16 | const {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'}, 17 | const {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'}, 18 | ], 19 | }; 20 | 21 | /// Descriptor for `Duration`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List durationDescriptor = $convert.base64Decode( 23 | 'CghEdXJhdGlvbhIYCgdzZWNvbmRzGAEgASgDUgdzZWNvbmRzEhQKBW5hbm9zGAIgASgFUgVuYW5vcw=='); 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.3 2 | Added the SDKResponse class in exports. 3 | 4 | ## 0.1.2 5 | Made the Recipe description optional on the sdk side. 6 | 7 | ## 0.1.1 8 | Added show stripe account. 9 | Upgraded the unilink to latest version. 10 | 11 | ## 0.1.0 12 | Get supported coins from the wallet. 13 | 14 | ## 0.0.9 15 | Get stripe registration info from the wallet. 16 | 17 | ## 0.0.8 18 | Sending redirection response to wallet. 19 | 20 | ## 0.0.7 21 | Add the functionality to allow and disallow the redirection from sdk 22 | 23 | ## 0.0.6 24 | Add the functionality to redirect to store if no wallet app installed 25 | 26 | ## 0.0.5 27 | Removed unnecessary code 28 | 29 | ## 0.0.4 30 | Updated New Protos. 31 | More functionalities are added. 32 | Recipe validations are added. 33 | 34 | 35 | ## 0.0.3 36 | More functionalities. 37 | 38 | ## 0.0.2 39 | Removed unused dependencies. 40 | Updated description 41 | 42 | ## 0.0.1 43 | 44 | Added support for create, update cookbook. 45 | Added support for create, update, enable and execute recipe. 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/src/features/helper/dec_string.dart: -------------------------------------------------------------------------------- 1 | library pylons_flutter_dec_string; 2 | 3 | /// Very rough compatibility functions for Cosmos' decimal types. 4 | /// 5 | /// TODO: This is a temporary solution to make working with decimals easier, but 6 | /// it is not a full port of the Cosmos decimal types, and should be deprecated upon 7 | /// the completion of such. 8 | class DecString { 9 | static const PRECISION = 18; 10 | static const MAX = 999999999999999999; 11 | static const ONE = 100000000000000000.0; 12 | 13 | /// Outputs a string containing a fixed-precision value of 18 places for the input double. 14 | static String decStringFromDouble(double f) { 15 | return (f * ONE).toStringAsPrecision(PRECISION).split('.').first; 16 | } 17 | 18 | /// Outputs a double containing the value represented by the input fixed-precision string of up to 18 places. 19 | static double doubleFromDecString(String f) { 20 | var i = int.parse(f); 21 | if (i > MAX) { 22 | throw Exception('$i requires more than $PRECISION places of precision'); 23 | } 24 | return i / ONE; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/src/generated/google/protobuf/timestamp.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: google/protobuf/timestamp.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use timestampDescriptor instead') 13 | const Timestamp$json = const { 14 | '1': 'Timestamp', 15 | '2': const [ 16 | const {'1': 'seconds', '3': 1, '4': 1, '5': 3, '10': 'seconds'}, 17 | const {'1': 'nanos', '3': 2, '4': 1, '5': 5, '10': 'nanos'}, 18 | ], 19 | }; 20 | 21 | /// Descriptor for `Timestamp`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List timestampDescriptor = $convert.base64Decode( 23 | 'CglUaW1lc3RhbXASGAoHc2Vjb25kcxgBIAEoA1IHc2Vjb25kcxIUCgVuYW5vcxgCIAEoBVIFbmFub3M='); 24 | -------------------------------------------------------------------------------- /test/src/features/data/models/item_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | // final jsonRaw = 5 | // '{"nodeVersion": "1.0", "cookbookId":"notARealCookbook001", "sender":"","ownerRecipeId":"n/a","ownerTradeId":"n/a", "tradable":true,"lastUpdate":1,"transferFee":1,"doubles":{},"longs": {},"strings":{}}'; 6 | 7 | test('Test Item from Json', () async { 8 | // Map jsonData = jsonDecode(jsonRaw); 9 | //final testItemFromJson = Item.fromJson((jsonData)); 10 | //expect(testItemFromJson.runtimeType, equals(Item)); 11 | //expect(testItemFromJson.nodeVersion, equals('1.0')); 12 | //expect(testItemFromJson.cookbookId, equals('notARealCookbook001')); 13 | //expect(testItemFromJson.ownerRecipeId, equals('n/a')); 14 | //expect(testItemFromJson.ownerTradeId, equals('n/a')); 15 | //expect(testItemFromJson.tradable, equals(true)); 16 | //expect(testItemFromJson.lastUpdate, equals(1)); 17 | //expect(testItemFromJson.sender, equals('')); 18 | //expect(testItemFromJson.transferFee, equals(1)); 19 | }); 20 | } 21 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/version/types.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/version/types.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use consensusDescriptor instead') 13 | const Consensus$json = const { 14 | '1': 'Consensus', 15 | '2': const [ 16 | const {'1': 'block', '3': 1, '4': 1, '5': 4, '10': 'block'}, 17 | const {'1': 'app', '3': 2, '4': 1, '5': 4, '10': 'app'}, 18 | ], 19 | '7': const {}, 20 | }; 21 | 22 | /// Descriptor for `Consensus`. Decode as a `google.protobuf.DescriptorProto`. 23 | final $typed_data.Uint8List consensusDescriptor = $convert.base64Decode( 24 | 'CglDb25zZW5zdXMSFAoFYmxvY2sYASABKARSBWJsb2NrEhAKA2FwcBgCIAEoBFIDYXBwOgTooB8B'); 25 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/standard_error.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/standard_error.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use standardErrorDescriptor instead') 13 | const StandardError$json = const { 14 | '1': 'StandardError', 15 | '2': const [ 16 | const {'1': 'code', '3': 1, '4': 1, '5': 9, '10': 'code'}, 17 | const {'1': 'message', '3': 2, '4': 1, '5': 9, '10': 'message'}, 18 | ], 19 | }; 20 | 21 | /// Descriptor for `StandardError`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List standardErrorDescriptor = $convert.base64Decode( 23 | 'Cg1TdGFuZGFyZEVycm9yEhIKBGNvZGUYASABKAlSBGNvZGUSGAoHbWVzc2FnZRgCIAEoCVIHbWVzc2FnZQ=='); 24 | -------------------------------------------------------------------------------- /test/helper/test_util.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:io'; 3 | 4 | import 'package:pylons_sdk/pylons_sdk.dart'; 5 | 6 | import '../mocks/mockedWallet.dart'; 7 | 8 | /// Utility functions for pylons_wallet_test 9 | class TestUtil { 10 | /// Set up MockWallet and (TODO) our mock backend stuff. 11 | static MockWallet mockIpcTarget() { 12 | return MockWallet(); 13 | } 14 | 15 | /// Load a file out of our test resources folder, get a string 16 | static String loadFile(String path) { 17 | final file = File('test_resources/$path'); 18 | return file.readAsStringSync(); 19 | } 20 | 21 | static Cookbook loadCookbook(String path) { 22 | var json = jsonDecode(loadFile(path)); 23 | final cb = Cookbook.fromJson(json); 24 | return cb; 25 | } 26 | 27 | static Recipe loadRecipe(String path) { 28 | var json = jsonDecode(loadFile(path)); 29 | final rcp = Recipe.fromJson(json); 30 | return rcp; 31 | } 32 | 33 | static Trade loadTrade(String path) { 34 | var json = jsonDecode(loadFile(path)); 35 | final trade = Trade.fromJson(json); 36 | return trade; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test_resources/trades/trade1.json: -------------------------------------------------------------------------------- 1 | { 2 | "NodeVersion": "0.0.1", 3 | "ID": "testTradeId1", 4 | "CoinInputs": null, 5 | "ItemInputs": [ 6 | { 7 | "CookbookID": "cb1", 8 | "ItemInput": { 9 | "ID": "", 10 | "Doubles": [ 11 | { 12 | "Key": "XP", 13 | "MinValue": "1", 14 | "MaxValue": "1000000" 15 | } 16 | ], 17 | "Longs": [ 18 | { 19 | "Key": "level", 20 | "MinValue": "1", 21 | "MaxValue": "2" 22 | } 23 | ], 24 | "Strings": [ 25 | { 26 | "Key": "Name", 27 | "Value": "IndustryBaby" 28 | } 29 | ], 30 | "TransferFee": { 31 | "MinValue": "0", 32 | "MaxValue": "0" 33 | } 34 | } 35 | } 36 | ], 37 | "CoinOutputs": [ 38 | { 39 | "denom": "pylon", 40 | "amount": "444" 41 | } 42 | ], 43 | "ItemOutputs": null, 44 | "ExtraInfo": "testing trade", 45 | "Sender": "testId", 46 | "FulFiller": "testId2", 47 | "Disabled": false, 48 | "Completed": true 49 | } 50 | -------------------------------------------------------------------------------- /test_resources/trades/trade2.json: -------------------------------------------------------------------------------- 1 | { 2 | "NodeVersion": "0.0.1", 3 | "ID": "testTradeId2", 4 | "CoinInputs": null, 5 | "ItemInputs": [ 6 | { 7 | "CookbookID": "cb1", 8 | "ItemInput": { 9 | "ID": "", 10 | "Doubles": [ 11 | { 12 | "Key": "XP", 13 | "MinValue": "1", 14 | "MaxValue": "1000000" 15 | } 16 | ], 17 | "Longs": [ 18 | { 19 | "Key": "level", 20 | "MinValue": "1", 21 | "MaxValue": "2" 22 | } 23 | ], 24 | "Strings": [ 25 | { 26 | "Key": "Name", 27 | "Value": "IndustryBaby" 28 | } 29 | ], 30 | "TransferFee": { 31 | "MinValue": "0", 32 | "MaxValue": "0" 33 | } 34 | } 35 | } 36 | ], 37 | "CoinOutputs": [ 38 | { 39 | "denom": "pylon", 40 | "amount": "444" 41 | } 42 | ], 43 | "ItemOutputs": null, 44 | "ExtraInfo": "testing trade", 45 | "Sender": "testId", 46 | "FulFiller": "testId2", 47 | "Disabled": false, 48 | "Completed": true 49 | } 50 | -------------------------------------------------------------------------------- /test_resources/trades/trade3.json: -------------------------------------------------------------------------------- 1 | { 2 | "NodeVersion": "0.0.1", 3 | "ID": "testTradeId3", 4 | "CoinInputs": null, 5 | "ItemInputs": [ 6 | { 7 | "CookbookID": "cb1", 8 | "ItemInput": { 9 | "ID": "", 10 | "Doubles": [ 11 | { 12 | "Key": "XP", 13 | "MinValue": "1", 14 | "MaxValue": "1000000" 15 | } 16 | ], 17 | "Longs": [ 18 | { 19 | "Key": "level", 20 | "MinValue": "1", 21 | "MaxValue": "2" 22 | } 23 | ], 24 | "Strings": [ 25 | { 26 | "Key": "Name", 27 | "Value": "IndustryBaby" 28 | } 29 | ], 30 | "TransferFee": { 31 | "MinValue": "0", 32 | "MaxValue": "0" 33 | } 34 | } 35 | } 36 | ], 37 | "CoinOutputs": [ 38 | { 39 | "denom": "pylon", 40 | "amount": "444" 41 | } 42 | ], 43 | "ItemOutputs": null, 44 | "ExtraInfo": "testing trade", 45 | "Sender": "testId", 46 | "FulFiller": "testId2", 47 | "Disabled": false, 48 | "Completed": true 49 | } 50 | -------------------------------------------------------------------------------- /.github/.workflows/github_actions.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | name: CI 3 | 4 | # Controls when the workflow will run 5 | on: 6 | # Triggers the workflow on push or pull request events but only for the main branch 7 | pull_request: 8 | branches: 9 | - main 10 | - develop 11 | 12 | # Allows you to run this workflow manually from the Actions tab 13 | workflow_dispatch: 14 | 15 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 16 | jobs: 17 | # This workflow contains a single job called "build" 18 | build: 19 | name: flutter build 20 | # The type of runner that the job will run on 21 | runs-on: ubuntu-latest 22 | env: 23 | JAVA_VERSION: "11.0" 24 | FLUTTER_VERSION: "2.5.3" 25 | steps: 26 | - uses: actions/checkout@v2 27 | - uses: actions/setup-java@v1 28 | with: 29 | java-version: $ 30 | - uses: subosito/flutter-action@v1 31 | with: 32 | flutter-version: $ 33 | - run: flutter pub get 34 | - run: flutter analyze --watch 35 | - run: flutter test 36 | 37 | -------------------------------------------------------------------------------- /test_resources/recipe/rcp1.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "good-recipe1", 3 | "cookbook": "cb1", 4 | "latestVersion": "0.1.0", 5 | "ids": { "local": "" }, 6 | "versions": { 7 | "0.1.0": { 8 | "NodeVersion": "", 9 | "ID": "", 10 | "Sender": "", 11 | "Disabled": false, 12 | "Name": "good-recipe1", 13 | "CookbookID": "cb1", 14 | "Description": "0.1.0|description of a recipe aaaaa", 15 | "BlockInterval": 0, 16 | "ExtraInfo": "", 17 | "CoinInputs": [ 18 | { 19 | "Coin": "pylon", 20 | "Count": 3 21 | } 22 | ], 23 | "ItemInputs": [], 24 | "Entries": { 25 | "CoinOutputs": [ 26 | { 27 | "ID": "scripOut", 28 | "Coin": "testcoin", 29 | "Count": "333" 30 | } 31 | ], 32 | "ItemOutputs": [], 33 | "ItemModifyOutputs": [] 34 | }, 35 | "Outputs": [ 36 | { 37 | "EntryIDs": ["scripOut"], 38 | "Weight": "1" 39 | } 40 | ] 41 | } 42 | }, 43 | "remotes": {}, 44 | "targetVersions": { 45 | "local": "0.1.0", 46 | "testnet": "0.1.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /test_resources/recipe/rcp3.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "good-recipe3", 3 | "cookbook": "cb3", 4 | "latestVersion": "0.1.0", 5 | "ids": { "local": "" }, 6 | "versions": { 7 | "0.1.0": { 8 | "NodeVersion": "", 9 | "ID": "", 10 | "Sender": "", 11 | "Disabled": false, 12 | "Name": "good-recipe3", 13 | "CookbookID": "cb3", 14 | "Description": "0.1.0|description of a recipe aaaaa", 15 | "BlockInterval": 0, 16 | "ExtraInfo": "", 17 | "CoinInputs": [ 18 | { 19 | "Coin": "pylon", 20 | "Count": 3 21 | } 22 | ], 23 | "ItemInputs": [], 24 | "Entries": { 25 | "CoinOutputs": [ 26 | { 27 | "ID": "scripOut", 28 | "Coin": "testcoin", 29 | "Count": "333" 30 | } 31 | ], 32 | "ItemOutputs": [], 33 | "ItemModifyOutputs": [] 34 | }, 35 | "Outputs": [ 36 | { 37 | "EntryIDs": ["scripOut"], 38 | "Weight": "1" 39 | } 40 | ] 41 | } 42 | }, 43 | "remotes": {}, 44 | "targetVersions": { 45 | "local": "0.1.0", 46 | "testnet": "0.1.0" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_cookbook_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 3 | import 'package:pylons_sdk/src/features/ipc/handlers/get_cookbooks_handler.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 5 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 6 | 7 | import '../../../../mocks/mock_constants.dart'; 8 | 9 | void main() { 10 | test('should complete the getCookBook Future ', () async { 11 | initResponseCompleter(Strings.GET_COOKBOOK); 12 | final sdkResponse = SDKIPCResponse( 13 | success: true, 14 | error: '', 15 | data: MOCK_COOKBOOK, 16 | errorCode: '', 17 | action: Strings.GET_COOKBOOK); 18 | final handler = GetCookbooksHandler(); 19 | Future.delayed(Duration(seconds: 1), () { 20 | handler.handler(sdkResponse); 21 | }); 22 | final response = await responseCompleters[Strings.GET_COOKBOOK]!.future; 23 | expect(true, responseCompleters[Strings.GET_COOKBOOK]!.isCompleted); 24 | expect(true, response.success); 25 | expect(Strings.GET_COOKBOOK, response.action); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /test_resources/recipe/rcp2.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "good-recipe2", 3 | "cookbook": "cb2", 4 | "latestVersion": "0.1.0", 5 | "ids": { 6 | "local": "" 7 | }, 8 | "versions": { 9 | "0.1.0": { 10 | "NodeVersion": "", 11 | "ID": "", 12 | "Sender": "", 13 | "Disabled": false, 14 | "Name": "good-recipe2", 15 | "CookbookID": "cb1", 16 | "Description": "0.1.0|description of a recipe aaaaa", 17 | "BlockInterval": 0, 18 | "ExtraInfo": "", 19 | "CoinInputs": [ 20 | { 21 | "Coin": "pylon", 22 | "Count": 3 23 | } 24 | ], 25 | "ItemInputs": [], 26 | "Entries": { 27 | "CoinOutputs": [ 28 | { 29 | "ID": "scripOut", 30 | "Coin": "testcoin", 31 | "Count": "333" 32 | } 33 | ], 34 | "ItemOutputs": [], 35 | "ItemModifyOutputs": [] 36 | }, 37 | "Outputs": [ 38 | { 39 | "EntryIDs": [ 40 | "scripOut" 41 | ], 42 | "Weight": "1" 43 | } 44 | ] 45 | } 46 | }, 47 | "remotes": {}, 48 | "targetVersions": { 49 | "local": "0.1.0", 50 | "testnet": "0.1.0" 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_cookbooks_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 6 | import '../../../../pylons_sdk.dart'; 7 | import '../responseCompleters.dart'; 8 | 9 | class GetCookbooksHandler implements IPCHandler { 10 | @override 11 | void handler(SDKIPCResponse response) { 12 | final defaultResponse = SDKIPCResponse( 13 | success: response.success, 14 | action: response.action, 15 | data: Cookbook.create(), 16 | error: response.error, 17 | errorCode: response.errorCode); 18 | try { 19 | if (response.success) { 20 | defaultResponse.data = Cookbook.create() 21 | ..mergeFromProto3Json(jsonDecode(response.data)); 22 | } 23 | } on Exception catch (_) { 24 | defaultResponse.success = false; 25 | defaultResponse.error = 'Cookbook parsing failed'; 26 | defaultResponse.errorCode = Strings.ERR_MALFORMED_COOKBOOK; 27 | } 28 | responseCompleters[Strings.GET_COOKBOOK]!.complete(defaultResponse); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_trades_handler.dart: -------------------------------------------------------------------------------- 1 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 2 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 3 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 4 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 5 | 6 | import '../../../../pylons_sdk.dart'; 7 | 8 | class GetTradesHandler implements IPCHandler { 9 | @override 10 | void handler(SDKIPCResponse response) { 11 | final defaultResponse = SDKIPCResponse>( 12 | success: response.success, 13 | action: response.action, 14 | data: [], 15 | error: response.error, 16 | errorCode: response.errorCode); 17 | try { 18 | if (response.success) { 19 | defaultResponse.data = List.from(response.data).map((e) { 20 | return Trade.create()..mergeFromProto3Json(e); 21 | }).toList(); 22 | } 23 | } on Exception catch (_) { 24 | defaultResponse.error = 'Trades parsing failed'; 25 | defaultResponse.errorCode = Strings.ERR_MALFORMED_TRADES; 26 | defaultResponse.success = false; 27 | } 28 | responseCompleters[Strings.GET_TRADES]!.complete(defaultResponse); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_recipes_handler.dart: -------------------------------------------------------------------------------- 1 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 2 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 3 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 4 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 5 | 6 | import '../../../../pylons_sdk.dart'; 7 | 8 | class GetRecipesHandler implements IPCHandler { 9 | @override 10 | void handler(SDKIPCResponse response) { 11 | final defaultResponse = SDKIPCResponse>( 12 | success: response.success, 13 | action: response.action, 14 | data: [], 15 | error: response.error, 16 | errorCode: response.errorCode); 17 | try { 18 | if (response.success) { 19 | defaultResponse.data = List.from(response.data).map((e) { 20 | return Recipe.create()..mergeFromProto3Json(e); 21 | }).toList(); 22 | } 23 | } on Exception catch (_) { 24 | defaultResponse.error = 'Recipe parsing failed'; 25 | defaultResponse.errorCode = Strings.ERR_MALFORMED_RECIPES; 26 | defaultResponse.success = false; 27 | } 28 | responseCompleters[Strings.GET_RECIPES]!.complete(defaultResponse); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_profile_hander_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/handlers/get_profile_handler.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 7 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 8 | 9 | import '../../../../mocks/mock_constants.dart'; 10 | 11 | void main() { 12 | test('should complete the getProfile Future ', () async { 13 | initResponseCompleter(Strings.GET_PROFILE); 14 | final sdkResponse = SDKIPCResponse( 15 | success: true, 16 | error: '', 17 | data: jsonEncode(MOCK_USER_INFO_MODEL.toJson()), 18 | errorCode: '', 19 | action: Strings.GET_PROFILE); 20 | final handler = GetProfileHandler(); 21 | Future.delayed(Duration(seconds: 1), () { 22 | handler.handler(sdkResponse); 23 | }); 24 | final response = await responseCompleters[Strings.GET_PROFILE]!.future; 25 | expect(true, responseCompleters[Strings.GET_PROFILE]!.isCompleted); 26 | expect(true, response.success); 27 | expect(Strings.GET_PROFILE, response.action); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/stripe_refund.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/stripe_refund.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use stripeRefundDescriptor instead') 13 | const StripeRefund$json = const { 14 | '1': 'StripeRefund', 15 | '2': const [ 16 | const { 17 | '1': 'payment', 18 | '3': 1, 19 | '4': 1, 20 | '5': 11, 21 | '6': '.pylons.pylons.PaymentInfo', 22 | '10': 'payment' 23 | }, 24 | const {'1': 'settled', '3': 2, '4': 1, '5': 8, '10': 'settled'}, 25 | ], 26 | }; 27 | 28 | /// Descriptor for `StripeRefund`. Decode as a `google.protobuf.DescriptorProto`. 29 | final $typed_data.Uint8List stripeRefundDescriptor = $convert.base64Decode( 30 | 'CgxTdHJpcGVSZWZ1bmQSNAoHcGF5bWVudBgBIAEoCzIaLnB5bG9ucy5weWxvbnMuUGF5bWVudEluZm9SB3BheW1lbnQSGAoHc2V0dGxlZBgCIAEoCFIHc2V0dGxlZA=='); 31 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_item_by_id_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 7 | 8 | import '../../../../pylons_sdk.dart'; 9 | 10 | class GetItemByIdHandler implements IPCHandler { 11 | @override 12 | void handler(SDKIPCResponse response) { 13 | final defaultResponse = SDKIPCResponse( 14 | success: response.success, 15 | action: response.action, 16 | data: Item.create()..createEmptyInstance(), 17 | error: response.error, 18 | errorCode: response.errorCode); 19 | 20 | try { 21 | if (response.success) { 22 | defaultResponse.data = Item.create() 23 | ..mergeFromProto3Json(jsonDecode(response.data)); 24 | } 25 | } on FormatException catch (_) { 26 | defaultResponse.error = _.message; 27 | defaultResponse.errorCode = Strings.ERR_MALFORMED_ITEM; 28 | defaultResponse.success = false; 29 | } 30 | responseCompleters[Strings.GET_ITEM_BY_ID]!.complete(defaultResponse); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_recipe_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 7 | 8 | import '../../../../pylons_sdk.dart'; 9 | 10 | class GetRecipeHandler implements IPCHandler { 11 | @override 12 | void handler(SDKIPCResponse response) { 13 | print(response); 14 | final defaultResponse = SDKIPCResponse( 15 | success: response.success, 16 | action: response.action, 17 | data: Recipe()..createEmptyInstance(), 18 | error: response.error, 19 | errorCode: response.errorCode); 20 | try { 21 | if (response.success) { 22 | defaultResponse.data = Recipe.create() 23 | ..mergeFromProto3Json(jsonDecode(response.data)); 24 | } 25 | } on FormatException catch (_) { 26 | defaultResponse.error = _.message; 27 | defaultResponse.errorCode = Strings.ERR_MALFORMED_RECIPE; 28 | defaultResponse.success = false; 29 | } 30 | responseCompleters[Strings.GET_RECIPE]!.complete(defaultResponse); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_execution_by_id_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 7 | import 'package:pylons_sdk/src/generated/pylons/execution.pb.dart'; 8 | 9 | class GetExecutionByIdHandler implements IPCHandler { 10 | @override 11 | void handler(SDKIPCResponse response) { 12 | final defaultResponse = SDKIPCResponse( 13 | success: response.success, 14 | action: response.action, 15 | data: Execution()..createEmptyInstance(), 16 | error: response.error, 17 | errorCode: response.errorCode); 18 | try { 19 | if (response.success) { 20 | defaultResponse.data = Execution.create() 21 | ..mergeFromProto3Json(jsonDecode(response.data)); 22 | } 23 | } on FormatException catch (_) { 24 | defaultResponse.error = _.message; 25 | defaultResponse.errorCode = Strings.ERR_MALFORMED_EXECUTION; 26 | defaultResponse.success = false; 27 | } 28 | responseCompleters[Strings.GET_EXECUTION_BY_ID]!.complete(defaultResponse); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_profile_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:developer'; 3 | 4 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 5 | import 'package:pylons_sdk/src/features/data/models/profile.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 7 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 8 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 9 | 10 | class GetProfileHandler implements IPCHandler { 11 | @override 12 | void handler(SDKIPCResponse response) { 13 | log(response.toString(), name: 'GetProfileHandler'); 14 | 15 | final defaultResponse = SDKIPCResponse( 16 | success: response.success, 17 | action: response.action, 18 | data: Profile.initial(), 19 | error: response.error, 20 | errorCode: response.errorCode); 21 | try { 22 | if (response.success) { 23 | defaultResponse.data = Profile.fromJson(jsonDecode(response.data)); 24 | } 25 | } on FormatException catch (_) { 26 | defaultResponse.error = _.message; 27 | defaultResponse.errorCode = Strings.ERR_MALFORMED_USER_INFO; 28 | defaultResponse.success = false; 29 | } 30 | responseCompleters[Strings.GET_PROFILE]!.complete(defaultResponse); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_list_items_by_owner_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 6 | import '../../../../pylons_sdk.dart'; 7 | import '../responseCompleters.dart'; 8 | 9 | class GetListItemsByOwnerHandler implements IPCHandler { 10 | @override 11 | void handler(SDKIPCResponse response) { 12 | final defaultResponse = SDKIPCResponse>( 13 | success: response.success, 14 | action: response.action, 15 | data: [], 16 | error: response.error, 17 | errorCode: response.errorCode); 18 | try { 19 | if (response.success) { 20 | defaultResponse.data = [ 21 | ...List.from(jsonDecode(response.data)) 22 | .map((item) => Item.create()..mergeFromProto3Json(item)) 23 | .toList() 24 | ]; 25 | } 26 | } on Exception catch (_) { 27 | defaultResponse.success = false; 28 | defaultResponse.error = 'Items list parsing failed'; 29 | defaultResponse.errorCode = Strings.ERR_MALFORMED_ITEMS_LIST; 30 | } 31 | responseCompleters[Strings.GET_ITEMS_BY_OWNER]!.complete(defaultResponse); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/src/features/models/sdk_ipc_message.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | /// A message to be sent to the wallet app. 4 | /// 5 | /// Stores raw, unencoded data which will then be used in IPC operations. 6 | class SDKIPCMessage { 7 | /// The operation to be performed by the wallet. 8 | String action; 9 | 10 | /// The data supplied for that operation. 11 | String json; 12 | String sender; 13 | bool requestResponse; 14 | 15 | SDKIPCMessage(this.action, this.json, this.sender, this.requestResponse); 16 | 17 | factory SDKIPCMessage.fromIPCMessage(String base64EncodedMessage) { 18 | final json = utf8.decode(base64Url.decode(base64EncodedMessage)); 19 | final jsonMap = jsonDecode(json); 20 | 21 | return SDKIPCMessage( 22 | jsonMap['action'].toString(), 23 | jsonMap['json'].toString(), 24 | jsonMap['sender'].toString(), 25 | jsonMap['request_response']); 26 | } 27 | 28 | String toJson() => jsonEncode({ 29 | 'sender': sender, 30 | 'json': json, 31 | 'action': action, 32 | 'request_response': requestResponse 33 | }); 34 | 35 | String createMessage() => base64Url.encode(utf8.encode(toJson())); 36 | 37 | @override 38 | String toString() { 39 | return 'SDKIPCMessage{action: $action, json: $json, sender: $sender, requestResponse: $requestResponse}'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/src/features/ipc/handlers/get_execution_by_recipe_handler.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/execution_list_by_recipe_response.dart'; 7 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 8 | 9 | class GetExecutionByRecipeHandler implements IPCHandler { 10 | @override 11 | void handler(SDKIPCResponse response) { 12 | final defaultResponse = SDKIPCResponse( 13 | success: response.success, 14 | action: response.action, 15 | data: ExecutionListByRecipeResponse.empty(), 16 | error: response.error, 17 | errorCode: response.errorCode); 18 | try { 19 | if (response.success) { 20 | defaultResponse.data = 21 | ExecutionListByRecipeResponse.fromJson(jsonDecode(response.data)); 22 | } 23 | } on FormatException catch (_) { 24 | defaultResponse.error = _.message; 25 | defaultResponse.errorCode = Strings.ERR_MALFORMED_EXECUTION; 26 | defaultResponse.success = false; 27 | } 28 | responseCompleters[Strings.GET_EXECUTION_BY_RECIPE_ID]! 29 | .complete(defaultResponse); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256k1/keys.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256k1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use pubKeyDescriptor instead') 13 | const PubKey$json = const { 14 | '1': 'PubKey', 15 | '2': const [ 16 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '10': 'key'}, 17 | ], 18 | '7': const {}, 19 | }; 20 | 21 | /// Descriptor for `PubKey`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List pubKeyDescriptor = 23 | $convert.base64Decode('CgZQdWJLZXkSEAoDa2V5GAEgASgMUgNrZXk6BJigHwA='); 24 | @$core.Deprecated('Use privKeyDescriptor instead') 25 | const PrivKey$json = const { 26 | '1': 'PrivKey', 27 | '2': const [ 28 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '10': 'key'}, 29 | ], 30 | }; 31 | 32 | /// Descriptor for `PrivKey`. Decode as a `google.protobuf.DescriptorProto`. 33 | final $typed_data.Uint8List privKeyDescriptor = 34 | $convert.base64Decode('CgdQcml2S2V5EhAKA2tleRgBIAEoDFIDa2V5'); 35 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/crypto/keys.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/crypto/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use publicKeyDescriptor instead') 13 | const PublicKey$json = const { 14 | '1': 'PublicKey', 15 | '2': const [ 16 | const {'1': 'ed25519', '3': 1, '4': 1, '5': 12, '9': 0, '10': 'ed25519'}, 17 | const { 18 | '1': 'secp256k1', 19 | '3': 2, 20 | '4': 1, 21 | '5': 12, 22 | '9': 0, 23 | '10': 'secp256k1' 24 | }, 25 | const {'1': 'sr25519', '3': 3, '4': 1, '5': 12, '9': 0, '10': 'sr25519'}, 26 | ], 27 | '7': const {}, 28 | '8': const [ 29 | const {'1': 'sum'}, 30 | ], 31 | }; 32 | 33 | /// Descriptor for `PublicKey`. Decode as a `google.protobuf.DescriptorProto`. 34 | final $typed_data.Uint8List publicKeyDescriptor = $convert.base64Decode( 35 | 'CglQdWJsaWNLZXkSGgoHZWQyNTUxORgBIAEoDEgAUgdlZDI1NTE5Eh4KCXNlY3AyNTZrMRgCIAEoDEgAUglzZWNwMjU2azESGgoHc3IyNTUxORgDIAEoDEgAUgdzcjI1NTE5OgjooR8B6KAfAUIFCgNzdW0='); 36 | -------------------------------------------------------------------------------- /lib/src/features/models/sdk_ipc_response.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | class SDKIPCResponse { 4 | bool success; 5 | String errorCode; 6 | String error; 7 | T data; 8 | String action; 9 | 10 | SDKIPCResponse( 11 | {required this.success, 12 | required this.error, 13 | required this.data, 14 | required this.errorCode, 15 | required this.action}); 16 | 17 | factory SDKIPCResponse.fromIPCMessage(String base64EncodedMessage) { 18 | final json = utf8.decode(base64Url.decode(base64EncodedMessage)); 19 | final jsonMap = jsonDecode(json); 20 | 21 | return SDKIPCResponse( 22 | error: jsonMap['error'], 23 | action: jsonMap['action'], 24 | errorCode: jsonMap['errorCode'], 25 | data: jsonMap['data'], 26 | success: jsonMap['success']); 27 | } 28 | 29 | factory SDKIPCResponse.success(T data) { 30 | return SDKIPCResponse( 31 | error: '', errorCode: '', action: '', data: data, success: true); 32 | } 33 | 34 | String toBas64Hash() => base64Url.encode(utf8.encode(toJson())); 35 | 36 | String toJson() => jsonEncode({ 37 | 'success': success, 38 | 'error': error, 39 | 'data': data, 40 | 'transaction': action 41 | }); 42 | 43 | @override 44 | String toString() { 45 | return 'SDKIPCResponse{success: $success, errorCode: $errorCode, error: $error, data: $data, action: $action}'; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/genesis.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use genesisStateDescriptor instead') 13 | const GenesisState$json = const { 14 | '1': 'GenesisState', 15 | '2': const [ 16 | const { 17 | '1': 'params', 18 | '3': 1, 19 | '4': 1, 20 | '5': 11, 21 | '6': '.cosmos.auth.v1beta1.Params', 22 | '8': const {}, 23 | '10': 'params' 24 | }, 25 | const { 26 | '1': 'accounts', 27 | '3': 2, 28 | '4': 3, 29 | '5': 11, 30 | '6': '.google.protobuf.Any', 31 | '10': 'accounts' 32 | }, 33 | ], 34 | }; 35 | 36 | /// Descriptor for `GenesisState`. Decode as a `google.protobuf.DescriptorProto`. 37 | final $typed_data.Uint8List genesisStateDescriptor = $convert.base64Decode( 38 | 'CgxHZW5lc2lzU3RhdGUSOQoGcGFyYW1zGAEgASgLMhsuY29zbW9zLmF1dGgudjFiZXRhMS5QYXJhbXNCBMjeHwBSBnBhcmFtcxIwCghhY2NvdW50cxgCIAMoCzIULmdvb2dsZS5wcm90b2J1Zi5BbnlSCGFjY291bnRz'); 39 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/history.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/history.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use historyDescriptor instead') 13 | const History$json = const { 14 | '1': 'History', 15 | '2': const [ 16 | const {'1': 'address', '3': 1, '4': 1, '5': 9, '10': 'address'}, 17 | const {'1': 'amount', '3': 2, '4': 1, '5': 9, '10': 'amount'}, 18 | const {'1': 'cookbook_id', '3': 3, '4': 1, '5': 9, '10': 'cookbookId'}, 19 | const {'1': 'recipe_id', '3': 4, '4': 1, '5': 9, '10': 'recipeId'}, 20 | const {'1': 'created_at', '3': 5, '4': 1, '5': 3, '10': 'createdAt'}, 21 | const {'1': 'type', '3': 6, '4': 1, '5': 9, '10': 'type'}, 22 | ], 23 | }; 24 | 25 | /// Descriptor for `History`. Decode as a `google.protobuf.DescriptorProto`. 26 | final $typed_data.Uint8List historyDescriptor = $convert.base64Decode( 27 | 'CgdIaXN0b3J5EhgKB2FkZHJlc3MYASABKAlSB2FkZHJlc3MSFgoGYW1vdW50GAIgASgJUgZhbW91bnQSHwoLY29va2Jvb2tfaWQYAyABKAlSCmNvb2tib29rSWQSGwoJcmVjaXBlX2lkGAQgASgJUghyZWNpcGVJZBIdCgpjcmVhdGVkX2F0GAUgASgDUgljcmVhdGVkQXQSEgoEdHlwZRgGIAEoCVIEdHlwZQ=='); 28 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/ed25519/keys.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/ed25519/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use pubKeyDescriptor instead') 13 | const PubKey$json = const { 14 | '1': 'PubKey', 15 | '2': const [ 16 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '8': const {}, '10': 'key'}, 17 | ], 18 | '7': const {}, 19 | }; 20 | 21 | /// Descriptor for `PubKey`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List pubKeyDescriptor = $convert.base64Decode( 23 | 'CgZQdWJLZXkSLgoDa2V5GAEgASgMQhz63h8YY3J5cHRvL2VkMjU1MTkuUHVibGljS2V5UgNrZXk6BJigHwA='); 24 | @$core.Deprecated('Use privKeyDescriptor instead') 25 | const PrivKey$json = const { 26 | '1': 'PrivKey', 27 | '2': const [ 28 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '8': const {}, '10': 'key'}, 29 | ], 30 | }; 31 | 32 | /// Descriptor for `PrivKey`. Decode as a `google.protobuf.DescriptorProto`. 33 | final $typed_data.Uint8List privKeyDescriptor = $convert.base64Decode( 34 | 'CgdQcml2S2V5Ei8KA2tleRgBIAEoDEId+t4fGWNyeXB0by9lZDI1NTE5LlByaXZhdGVLZXlSA2tleQ=='); 35 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/secp256r1/keys.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/secp256r1/keys.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use pubKeyDescriptor instead') 13 | const PubKey$json = const { 14 | '1': 'PubKey', 15 | '2': const [ 16 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '8': const {}, '10': 'key'}, 17 | ], 18 | }; 19 | 20 | /// Descriptor for `PubKey`. Decode as a `google.protobuf.DescriptorProto`. 21 | final $typed_data.Uint8List pubKeyDescriptor = $convert 22 | .base64Decode('CgZQdWJLZXkSHQoDa2V5GAEgASgMQgva3h8HZWNkc2FQS1IDa2V5'); 23 | @$core.Deprecated('Use privKeyDescriptor instead') 24 | const PrivKey$json = const { 25 | '1': 'PrivKey', 26 | '2': const [ 27 | const { 28 | '1': 'secret', 29 | '3': 1, 30 | '4': 1, 31 | '5': 12, 32 | '8': const {}, 33 | '10': 'secret' 34 | }, 35 | ], 36 | }; 37 | 38 | /// Descriptor for `PrivKey`. Decode as a `google.protobuf.DescriptorProto`. 39 | final $typed_data.Uint8List privKeyDescriptor = $convert.base64Decode( 40 | 'CgdQcml2S2V5EiMKBnNlY3JldBgBIAEoDEIL2t4fB2VjZHNhU0tSBnNlY3JldA=='); 41 | -------------------------------------------------------------------------------- /test/mocks/mock_uni_link.dart: -------------------------------------------------------------------------------- 1 | // Mocks generated by Mockito 5.0.16 from annotations 2 | // in pylons_flutter/test/pylons_wallet/pylons_wallet_impl_test.dart. 3 | // Do not manually edit this file. 4 | 5 | import 'dart:async' as _i3; 6 | 7 | import 'package:mockito/mockito.dart' as _i1; 8 | import 'package:uni_links_platform_interface/uni_links_platform_interface.dart' 9 | as _i2; 10 | 11 | // ignore_for_file: avoid_redundant_argument_values 12 | // ignore_for_file: avoid_setters_without_getters 13 | // ignore_for_file: comment_references 14 | // ignore_for_file: implementation_imports 15 | // ignore_for_file: invalid_use_of_visible_for_testing_member 16 | // ignore_for_file: prefer_const_constructors 17 | // ignore_for_file: unnecessary_parenthesis 18 | // ignore_for_file: camel_case_types 19 | 20 | /// A class which mocks [UniLinksPlatform]. 21 | /// 22 | /// See the documentation for Mockito's code generation for more information. 23 | class MockUniLinksPlatform extends _i1.Mock implements _i2.UniLinksPlatform { 24 | MockUniLinksPlatform() { 25 | _i1.throwOnMissingStub(this); 26 | } 27 | 28 | @override 29 | _i3.Stream get linkStream => 30 | (super.noSuchMethod(Invocation.getter(#linkStream), 31 | returnValue: Stream.empty()) as _i3.Stream); 32 | @override 33 | _i3.Future getInitialLink() => 34 | (super.noSuchMethod(Invocation.method(#getInitialLink, []), 35 | returnValue: Future.value()) as _i3.Future); 36 | @override 37 | String toString() => super.toString(); 38 | } 39 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/apple_in_app_purchase_order.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/apple_in_app_purchase_order.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use appleInAppPurchaseOrderDescriptor instead') 13 | const AppleInAppPurchaseOrder$json = const { 14 | '1': 'AppleInAppPurchaseOrder', 15 | '2': const [ 16 | const {'1': 'quantity', '3': 1, '4': 1, '5': 9, '10': 'quantity'}, 17 | const {'1': 'product_id', '3': 2, '4': 1, '5': 9, '10': 'productId'}, 18 | const {'1': 'purchase_id', '3': 3, '4': 1, '5': 9, '10': 'purchaseId'}, 19 | const {'1': 'purchase_date', '3': 4, '4': 1, '5': 9, '10': 'purchaseDate'}, 20 | const {'1': 'creator', '3': 5, '4': 1, '5': 9, '10': 'creator'}, 21 | ], 22 | }; 23 | 24 | /// Descriptor for `AppleInAppPurchaseOrder`. Decode as a `google.protobuf.DescriptorProto`. 25 | final $typed_data.Uint8List appleInAppPurchaseOrderDescriptor = 26 | $convert.base64Decode( 27 | 'ChdBcHBsZUluQXBwUHVyY2hhc2VPcmRlchIaCghxdWFudGl0eRgBIAEoCVIIcXVhbnRpdHkSHQoKcHJvZHVjdF9pZBgCIAEoCVIJcHJvZHVjdElkEh8KC3B1cmNoYXNlX2lkGAMgASgJUgpwdXJjaGFzZUlkEiMKDXB1cmNoYXNlX2RhdGUYBCABKAlSDHB1cmNoYXNlRGF0ZRIYCgdjcmVhdG9yGAUgASgJUgdjcmVhdG9y'); 28 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | linter: 2 | rules: 3 | - always_declare_return_types 4 | - always_require_non_null_named_parameters 5 | - annotate_overrides 6 | - avoid_empty_else 7 | - avoid_init_to_null 8 | - avoid_null_checks_in_equality_operators 9 | - avoid_relative_lib_imports 10 | - avoid_return_types_on_setters 11 | - avoid_shadowing_type_parameters 12 | - avoid_types_as_parameter_names 13 | - camel_case_extensions 14 | - curly_braces_in_flow_control_structures 15 | - empty_catches 16 | - empty_constructor_bodies 17 | - library_names 18 | - library_prefixes 19 | - no_duplicate_case_values 20 | - null_closures 21 | - omit_local_variable_types 22 | - prefer_adjacent_string_concatenation 23 | - prefer_collection_literals 24 | - prefer_conditional_assignment 25 | - prefer_contains 26 | - prefer_equal_for_default_values 27 | - prefer_final_fields 28 | - prefer_for_elements_to_map_fromIterable 29 | - prefer_generic_function_type_aliases 30 | - prefer_if_null_operators 31 | - prefer_is_empty 32 | - prefer_is_not_empty 33 | - prefer_iterable_whereType 34 | - prefer_single_quotes 35 | - prefer_spread_collections 36 | - recursive_getters 37 | - slash_for_doc_comments 38 | - type_init_formals 39 | - unawaited_futures 40 | - unnecessary_const 41 | - unnecessary_new 42 | - unnecessary_null_in_if_null_operators 43 | - unnecessary_this 44 | - unrelated_type_equality_checks 45 | - use_function_type_syntax_for_parameters 46 | - use_rethrow_when_possible 47 | - valid_regexps -------------------------------------------------------------------------------- /lib/src/features/models/execution_list_by_recipe_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:pylons_sdk/src/generated/pylons/execution.pb.dart'; 2 | 3 | class ExecutionListByRecipeResponse { 4 | final List completedExecutions; 5 | final List pendingExecutions; 6 | 7 | ExecutionListByRecipeResponse( 8 | {required this.completedExecutions, required this.pendingExecutions}); 9 | factory ExecutionListByRecipeResponse.empty() { 10 | return ExecutionListByRecipeResponse( 11 | pendingExecutions: [], completedExecutions: []); 12 | } 13 | 14 | Map toJson() => { 15 | 'completedExecutions': completedExecutions 16 | .map((execution) => execution.toProto3Json()) 17 | .toList(), 18 | 'pendingExecutions': pendingExecutions 19 | .map((execution) => execution.toProto3Json()) 20 | .toList() 21 | }; 22 | 23 | factory ExecutionListByRecipeResponse.fromJson(Map json) { 24 | return ExecutionListByRecipeResponse( 25 | pendingExecutions: List.from(json['pendingExecutions']) 26 | .map((execution) => 27 | Execution.create()..mergeFromProto3Json(execution)) 28 | .toList(), 29 | completedExecutions: List.from(json['completedExecutions']) 30 | .map((execution) => 31 | Execution.create()..mergeFromProto3Json(execution)) 32 | .toList()); 33 | } 34 | 35 | @override 36 | String toString() { 37 | return 'ExecutionListByRecipeResponse{completedExecutions: $completedExecutions, pendingExecutions: $pendingExecutions}'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/query.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/query.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:async' as $async; 9 | 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | import 'dart:core' as $core; 13 | import 'query.pb.dart' as $4; 14 | import 'query.pbjson.dart'; 15 | 16 | export 'query.pb.dart'; 17 | 18 | abstract class QueryServiceBase extends $pb.GeneratedService { 19 | $async.Future<$4.QueryGrantsResponse> grants( 20 | $pb.ServerContext ctx, $4.QueryGrantsRequest request); 21 | 22 | $pb.GeneratedMessage createRequest($core.String method) { 23 | switch (method) { 24 | case 'Grants': 25 | return $4.QueryGrantsRequest(); 26 | default: 27 | throw $core.ArgumentError('Unknown method: $method'); 28 | } 29 | } 30 | 31 | $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, 32 | $core.String method, $pb.GeneratedMessage request) { 33 | switch (method) { 34 | case 'Grants': 35 | return this.grants(ctx, request as $4.QueryGrantsRequest); 36 | default: 37 | throw $core.ArgumentError('Unknown method: $method'); 38 | } 39 | } 40 | 41 | $core.Map<$core.String, $core.dynamic> get $json => QueryServiceBase$json; 42 | $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> 43 | get $messageJson => QueryServiceBase$messageJson; 44 | } 45 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_item_by_id_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/pylons_sdk.dart'; 5 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/handlers/get_item_by_id_handler.dart'; 7 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 8 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 9 | 10 | import '../../../../mocks/mock_constants.dart'; 11 | 12 | void main() { 13 | test('should complete the get item by id handler future', () { 14 | initResponseCompleter(Strings.GET_ITEM_BY_ID); 15 | var sdkResponse = SDKIPCResponse( 16 | success: false, error: '', data: '', errorCode: '', action: ''); 17 | var handler = GetItemByIdHandler(); 18 | handler.handler(sdkResponse); 19 | expect(true, responseCompleters[Strings.GET_ITEM_BY_ID]!.isCompleted); 20 | }); 21 | 22 | test('should complete the get item by id with data ', () async { 23 | initResponseCompleter(Strings.GET_ITEM_BY_ID); 24 | var sdkResponse = SDKIPCResponse( 25 | success: true, 26 | error: '', 27 | data: jsonEncode(MOCK_ITEM.toProto3Json()), 28 | errorCode: '', 29 | action: ''); 30 | var handler = GetItemByIdHandler(); 31 | 32 | Future.delayed(Duration(seconds: 1), () { 33 | handler.handler(sdkResponse); 34 | expect(true, responseCompleters[Strings.GET_ITEM_BY_ID]!.isCompleted); 35 | }); 36 | 37 | var response = await responseCompleters[Strings.GET_ITEM_BY_ID]!.future; 38 | 39 | expect(true, response.success); 40 | expect(true, response.data is Item); 41 | }); 42 | } 43 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/google_iap_order.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/google_iap_order.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use googleInAppPurchaseOrderDescriptor instead') 13 | const GoogleInAppPurchaseOrder$json = const { 14 | '1': 'GoogleInAppPurchaseOrder', 15 | '2': const [ 16 | const {'1': 'creator', '3': 1, '4': 1, '5': 9, '10': 'creator'}, 17 | const {'1': 'product_id', '3': 2, '4': 1, '5': 9, '10': 'productId'}, 18 | const { 19 | '1': 'purchase_token', 20 | '3': 3, 21 | '4': 1, 22 | '5': 9, 23 | '10': 'purchaseToken' 24 | }, 25 | const { 26 | '1': 'receipt_data_base64', 27 | '3': 4, 28 | '4': 1, 29 | '5': 9, 30 | '10': 'receiptDataBase64' 31 | }, 32 | const {'1': 'signature', '3': 5, '4': 1, '5': 9, '10': 'signature'}, 33 | ], 34 | }; 35 | 36 | /// Descriptor for `GoogleInAppPurchaseOrder`. Decode as a `google.protobuf.DescriptorProto`. 37 | final $typed_data.Uint8List googleInAppPurchaseOrderDescriptor = 38 | $convert.base64Decode( 39 | 'ChhHb29nbGVJbkFwcFB1cmNoYXNlT3JkZXISGAoHY3JlYXRvchgBIAEoCVIHY3JlYXRvchIdCgpwcm9kdWN0X2lkGAIgASgJUglwcm9kdWN0SWQSJQoOcHVyY2hhc2VfdG9rZW4YAyABKAlSDXB1cmNoYXNlVG9rZW4SLgoTcmVjZWlwdF9kYXRhX2Jhc2U2NBgEIAEoCVIRcmVjZWlwdERhdGFCYXNlNjQSHAoJc2lnbmF0dXJlGAUgASgJUglzaWduYXR1cmU='); 40 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_execution_by_id_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/handlers/get_execution_by_id_handler.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 7 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 8 | 9 | import '../../../../mocks/mock_constants.dart'; 10 | 11 | void main() { 12 | test('should complete the get execution based on id handler future', () { 13 | initResponseCompleter(Strings.GET_EXECUTION_BY_ID); 14 | var sdkResponse = SDKIPCResponse( 15 | success: false, error: '', data: '', errorCode: '', action: ''); 16 | var handler = GetExecutionByIdHandler(); 17 | handler.handler(sdkResponse); 18 | expect(true, responseCompleters[Strings.GET_EXECUTION_BY_ID]!.isCompleted); 19 | }); 20 | 21 | test('should complete the get execution by id with data ', () async { 22 | initResponseCompleter(Strings.GET_EXECUTION_BY_ID); 23 | var sdkResponse = SDKIPCResponse( 24 | success: true, 25 | error: '', 26 | data: jsonEncode(MOCK_EXECUTION.toProto3Json()), 27 | errorCode: '', 28 | action: ''); 29 | var handler = GetExecutionByIdHandler(); 30 | 31 | Future.delayed(Duration(seconds: 1), () { 32 | handler.handler(sdkResponse); 33 | expect( 34 | true, responseCompleters[Strings.GET_EXECUTION_BY_ID]!.isCompleted); 35 | }); 36 | 37 | var response = 38 | await responseCompleters[Strings.GET_EXECUTION_BY_ID]!.future; 39 | 40 | expect(true, response.success); 41 | expect(MOCK_EXECUTION, response.data); 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/crypto/multisig/v1beta1/multisig.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/crypto/multisig/v1beta1/multisig.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use multiSignatureDescriptor instead') 13 | const MultiSignature$json = const { 14 | '1': 'MultiSignature', 15 | '2': const [ 16 | const {'1': 'signatures', '3': 1, '4': 3, '5': 12, '10': 'signatures'}, 17 | ], 18 | '7': const {}, 19 | }; 20 | 21 | /// Descriptor for `MultiSignature`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List multiSignatureDescriptor = $convert.base64Decode( 23 | 'Cg5NdWx0aVNpZ25hdHVyZRIeCgpzaWduYXR1cmVzGAEgAygMUgpzaWduYXR1cmVzOgTQoR8B'); 24 | @$core.Deprecated('Use compactBitArrayDescriptor instead') 25 | const CompactBitArray$json = const { 26 | '1': 'CompactBitArray', 27 | '2': const [ 28 | const { 29 | '1': 'extra_bits_stored', 30 | '3': 1, 31 | '4': 1, 32 | '5': 13, 33 | '10': 'extraBitsStored' 34 | }, 35 | const {'1': 'elems', '3': 2, '4': 1, '5': 12, '10': 'elems'}, 36 | ], 37 | '7': const {}, 38 | }; 39 | 40 | /// Descriptor for `CompactBitArray`. Decode as a `google.protobuf.DescriptorProto`. 41 | final $typed_data.Uint8List compactBitArrayDescriptor = $convert.base64Decode( 42 | 'Cg9Db21wYWN0Qml0QXJyYXkSKgoRZXh0cmFfYml0c19zdG9yZWQYASABKA1SD2V4dHJhQml0c1N0b3JlZBIUCgVlbGVtcxgCIAEoDFIFZWxlbXM6BJigHwA='); 43 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/payment_info.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/payment_info.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use paymentInfoDescriptor instead') 13 | const PaymentInfo$json = const { 14 | '1': 'PaymentInfo', 15 | '2': const [ 16 | const {'1': 'purchase_id', '3': 1, '4': 1, '5': 9, '10': 'purchaseId'}, 17 | const { 18 | '1': 'processor_name', 19 | '3': 2, 20 | '4': 1, 21 | '5': 9, 22 | '10': 'processorName' 23 | }, 24 | const {'1': 'payer_addr', '3': 3, '4': 1, '5': 9, '10': 'payerAddr'}, 25 | const { 26 | '1': 'amount', 27 | '3': 4, 28 | '4': 1, 29 | '5': 9, 30 | '8': const {}, 31 | '10': 'amount' 32 | }, 33 | const {'1': 'product_id', '3': 5, '4': 1, '5': 9, '10': 'productId'}, 34 | const {'1': 'signature', '3': 6, '4': 1, '5': 9, '10': 'signature'}, 35 | ], 36 | }; 37 | 38 | /// Descriptor for `PaymentInfo`. Decode as a `google.protobuf.DescriptorProto`. 39 | final $typed_data.Uint8List paymentInfoDescriptor = $convert.base64Decode( 40 | 'CgtQYXltZW50SW5mbxIfCgtwdXJjaGFzZV9pZBgBIAEoCVIKcHVyY2hhc2VJZBIlCg5wcm9jZXNzb3JfbmFtZRgCIAEoCVINcHJvY2Vzc29yTmFtZRIdCgpwYXllcl9hZGRyGAMgASgJUglwYXllckFkZHISRgoGYW1vdW50GAQgASgJQi7I3h8A2t4fJmdpdGh1Yi5jb20vY29zbW9zL2Nvc21vcy1zZGsvdHlwZXMuSW50UgZhbW91bnQSHQoKcHJvZHVjdF9pZBgFIAEoCVIJcHJvZHVjdElkEhwKCXNpZ25hdHVyZRgGIAEoCVIJc2lnbmF0dXJl'); 41 | -------------------------------------------------------------------------------- /lib/src/features/ipc/responseCompleters.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 4 | 5 | /// Map of message/response keys to completer references. 6 | /// 7 | /// NOTES ON DESIGN/USAGE OF THESE COMPLETERS: 8 | /// 9 | /// a) This is a simple persistence mechanism to enable the response-handler layer to grab 10 | /// references to the Completer instances used in the initial API calls. Each of these is 11 | /// a completer "slot" that's populated w/ a new completer when the appropriate API call fires. 12 | /// The next response matching that key will grab the completer in that slot and complete it. 13 | /// Because of this, there are a few gotchas that future maintainers of this codebase should 14 | /// be aware of. 15 | /// 16 | /// b) This means that each SDK call _must_ re-initialize the completer when it is called. If 17 | /// the completer is not initialized by the method body, it'll contain a reference to an old 18 | /// (completed) completer when the response grabs it, and bad things will happen. 19 | /// 20 | /// c) So, don't create these manually. Use the [initResponseCompleter] helper function instead to 21 | /// minimize the chance for dumb bugs to creep in. 22 | final Map> responseCompleters = { 23 | // since initResponseCompleter is always called for any given key before a valid response can be handled, 24 | // we don't need to set them up individually here. either it'll be in the map when you look, 25 | // or you're doing something wrong and should expect a crash regardless. 26 | }; 27 | 28 | /// Initialize a response completer for [key] and return that completer. 29 | Completer initResponseCompleter(String key) { 30 | responseCompleters[key] = Completer(); 31 | return responseCompleters[key]!; 32 | } 33 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_items_by_owner_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/pylons_sdk.dart'; 5 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/handlers/get_list_items_by_owner_handler.dart'; 7 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 8 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 9 | 10 | import '../../../../mocks/mock_constants.dart'; 11 | 12 | void main() { 13 | test('should complete the get item by owner handler future', () { 14 | initResponseCompleter(Strings.GET_ITEMS_BY_OWNER); 15 | var sdkResponse = SDKIPCResponse( 16 | success: false, 17 | error: '', 18 | data: [MOCK_ITEM..toProto3Json()], 19 | errorCode: '', 20 | action: ''); 21 | var handler = GetListItemsByOwnerHandler(); 22 | handler.handler(sdkResponse); 23 | expect(true, responseCompleters[Strings.GET_ITEMS_BY_OWNER]!.isCompleted); 24 | }); 25 | 26 | test('should complete the get item by owner with data ', () async { 27 | initResponseCompleter(Strings.GET_ITEMS_BY_OWNER); 28 | var sdkResponse = SDKIPCResponse( 29 | success: true, 30 | error: '', 31 | data: jsonEncode([MOCK_ITEM.toProto3Json()]), 32 | errorCode: '', 33 | action: ''); 34 | var handler = GetListItemsByOwnerHandler(); 35 | 36 | Future.delayed(Duration(seconds: 1), () { 37 | handler.handler(sdkResponse); 38 | expect(true, responseCompleters[Strings.GET_ITEMS_BY_OWNER]!.isCompleted); 39 | }); 40 | 41 | var response = await responseCompleters[Strings.GET_ITEMS_BY_OWNER]!.future; 42 | 43 | expect(true, response.success); 44 | expect(true, response.data is List); 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/cookbook.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/cookbook.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use cookbookDescriptor instead') 13 | const Cookbook$json = const { 14 | '1': 'Cookbook', 15 | '2': const [ 16 | const {'1': 'creator', '3': 1, '4': 1, '5': 9, '10': 'creator'}, 17 | const {'1': 'id', '3': 2, '4': 1, '5': 9, '10': 'id'}, 18 | const {'1': 'node_version', '3': 3, '4': 1, '5': 4, '10': 'nodeVersion'}, 19 | const {'1': 'name', '3': 4, '4': 1, '5': 9, '10': 'name'}, 20 | const {'1': 'description', '3': 5, '4': 1, '5': 9, '10': 'description'}, 21 | const {'1': 'developer', '3': 6, '4': 1, '5': 9, '10': 'developer'}, 22 | const {'1': 'version', '3': 7, '4': 1, '5': 9, '10': 'version'}, 23 | const {'1': 'support_email', '3': 8, '4': 1, '5': 9, '10': 'supportEmail'}, 24 | const {'1': 'enabled', '3': 9, '4': 1, '5': 8, '10': 'enabled'}, 25 | ], 26 | }; 27 | 28 | /// Descriptor for `Cookbook`. Decode as a `google.protobuf.DescriptorProto`. 29 | final $typed_data.Uint8List cookbookDescriptor = $convert.base64Decode( 30 | 'CghDb29rYm9vaxIYCgdjcmVhdG9yGAEgASgJUgdjcmVhdG9yEg4KAmlkGAIgASgJUgJpZBIhCgxub2RlX3ZlcnNpb24YAyABKARSC25vZGVWZXJzaW9uEhIKBG5hbWUYBCABKAlSBG5hbWUSIAoLZGVzY3JpcHRpb24YBSABKAlSC2Rlc2NyaXB0aW9uEhwKCWRldmVsb3BlchgGIAEoCVIJZGV2ZWxvcGVyEhgKB3ZlcnNpb24YByABKAlSB3ZlcnNpb24SIwoNc3VwcG9ydF9lbWFpbBgIIAEoCVIMc3VwcG9ydEVtYWlsEhgKB2VuYWJsZWQYCSABKAhSB2VuYWJsZWQ='); 31 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/signing/v1beta1/signing.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/signing/v1beta1/signing.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | 8 | // ignore_for_file: UNDEFINED_SHOWN_NAME 9 | import 'dart:core' as $core; 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | class SignMode extends $pb.ProtobufEnum { 13 | static const SignMode SIGN_MODE_UNSPECIFIED = SignMode._( 14 | 0, 15 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 16 | ? '' 17 | : 'SIGN_MODE_UNSPECIFIED'); 18 | static const SignMode SIGN_MODE_DIRECT = SignMode._( 19 | 1, 20 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 21 | ? '' 22 | : 'SIGN_MODE_DIRECT'); 23 | static const SignMode SIGN_MODE_TEXTUAL = SignMode._( 24 | 2, 25 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 26 | ? '' 27 | : 'SIGN_MODE_TEXTUAL'); 28 | static const SignMode SIGN_MODE_LEGACY_AMINO_JSON = SignMode._( 29 | 127, 30 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 31 | ? '' 32 | : 'SIGN_MODE_LEGACY_AMINO_JSON'); 33 | 34 | static const $core.List values = [ 35 | SIGN_MODE_UNSPECIFIED, 36 | SIGN_MODE_DIRECT, 37 | SIGN_MODE_TEXTUAL, 38 | SIGN_MODE_LEGACY_AMINO_JSON, 39 | ]; 40 | 41 | static final $core.Map<$core.int, SignMode> _byValue = 42 | $pb.ProtobufEnum.initByValue(values); 43 | static SignMode? valueOf($core.int value) => _byValue[value]; 44 | 45 | const SignMode._($core.int v, $core.String n) : super(v, n); 46 | } 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | coverage/ 33 | 34 | 35 | # Android related 36 | **/android/**/gradle-wrapper.jar 37 | **/android/.gradle 38 | **/android/captures/ 39 | **/android/gradlew 40 | **/android/gradlew.bat 41 | **/android/local.properties 42 | **/android/**/GeneratedPluginRegistrant.java 43 | 44 | # iOS/XCode related 45 | **/ios/**/*.mode1v3 46 | **/ios/**/*.mode2v3 47 | **/ios/**/*.moved-aside 48 | **/ios/**/*.pbxuser 49 | **/ios/**/*.perspectivev3 50 | **/ios/**/*sync/ 51 | **/ios/**/.sconsign.dblite 52 | **/ios/**/.tags* 53 | **/ios/**/.vagrant/ 54 | **/ios/**/DerivedData/ 55 | **/ios/**/Icon? 56 | **/ios/**/Pods/ 57 | **/ios/**/.symlinks/ 58 | **/ios/**/profile 59 | **/ios/**/xcuserdata 60 | **/ios/.generated/ 61 | **/ios/Flutter/App.framework 62 | **/ios/Flutter/Flutter.framework 63 | **/ios/Flutter/Flutter.podspec 64 | **/ios/Flutter/Generated.xcconfig 65 | **/ios/Flutter/ephemeral 66 | **/ios/Flutter/app.flx 67 | **/ios/Flutter/app.zip 68 | **/ios/Flutter/flutter_assets/ 69 | **/ios/Flutter/flutter_export_environment.sh 70 | **/ios/ServiceDefinitions.json 71 | **/ios/Runner/GeneratedPluginRegistrant.* 72 | 73 | # Exceptions to above rules. 74 | !**/ios/**/default.mode1v3 75 | !**/ios/**/default.mode2v3 76 | !**/ios/**/default.pbxuser 77 | !**/ios/**/default.perspectivev3 78 | 79 | 80 | pubspec.lock 81 | -------------------------------------------------------------------------------- /test/src/features/models/ipc_response_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 3 | 4 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 5 | 6 | import '../../../mocks/mock_constants.dart'; 7 | 8 | void main() { 9 | test('should give success response for the encoded message', () { 10 | const message = 11 | 'ewoJImFjdGlvbiI6ICJnZXRQcm9maWxlIiwKCSJzdWNjZXNzIjogdHJ1ZSwKCSJlcnJvciI6ICIiLAoJImVycm9yQ29kZSI6ICIiLAoJImRhdGEiOiAiSmF3YWQiCn0='; 12 | 13 | final sdkMessage = SDKIPCResponse.fromIPCMessage(message); 14 | expect(Strings.GET_PROFILE, sdkMessage.action); 15 | expect(true, sdkMessage.success); 16 | expect(MOCK_USERNAME, sdkMessage.data); 17 | expect(true, sdkMessage.errorCode.isEmpty); 18 | expect(true, sdkMessage.error.isEmpty); 19 | expect( 20 | 'SDKIPCResponse{success: true, errorCode: , error: , data: $MOCK_USERNAME, action: ${Strings.GET_PROFILE}}', 21 | sdkMessage.toString()); 22 | }); 23 | 24 | test('should give error response for the encoded message', () { 25 | const message = 26 | 'ewoJImFjdGlvbiI6ICJnZXRQcm9maWxlIiwKCSJzdWNjZXNzIjogZmFsc2UsCgkiZXJyb3IiOiAiV2FsbGV0IGRvZXNuJ3QgZXhpc3RzIiwKCSJlcnJvckNvZGUiOiAic29tZXRoaW5nV2VudFdyb25nIiwKCSJkYXRhIjogIiIKfQ=='; 27 | 28 | final sdkMessage = SDKIPCResponse.fromIPCMessage(message); 29 | expect(Strings.GET_PROFILE, sdkMessage.action); 30 | expect(false, sdkMessage.success); 31 | expect(true, sdkMessage.data.isEmpty); 32 | expect('somethingWentWrong', sdkMessage.errorCode); 33 | expect('Wallet doesn\'t exists', sdkMessage.error); 34 | expect( 35 | 'SDKIPCResponse{success: false, errorCode: somethingWentWrong, error: Wallet doesn\'t exists, data: , action: ${Strings.GET_PROFILE}}', 36 | sdkMessage.toString()); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/event.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/event.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use eventGrantDescriptor instead') 13 | const EventGrant$json = const { 14 | '1': 'EventGrant', 15 | '2': const [ 16 | const {'1': 'msg_type_url', '3': 2, '4': 1, '5': 9, '10': 'msgTypeUrl'}, 17 | const {'1': 'granter', '3': 3, '4': 1, '5': 9, '10': 'granter'}, 18 | const {'1': 'grantee', '3': 4, '4': 1, '5': 9, '10': 'grantee'}, 19 | ], 20 | }; 21 | 22 | /// Descriptor for `EventGrant`. Decode as a `google.protobuf.DescriptorProto`. 23 | final $typed_data.Uint8List eventGrantDescriptor = $convert.base64Decode( 24 | 'CgpFdmVudEdyYW50EiAKDG1zZ190eXBlX3VybBgCIAEoCVIKbXNnVHlwZVVybBIYCgdncmFudGVyGAMgASgJUgdncmFudGVyEhgKB2dyYW50ZWUYBCABKAlSB2dyYW50ZWU='); 25 | @$core.Deprecated('Use eventRevokeDescriptor instead') 26 | const EventRevoke$json = const { 27 | '1': 'EventRevoke', 28 | '2': const [ 29 | const {'1': 'msg_type_url', '3': 2, '4': 1, '5': 9, '10': 'msgTypeUrl'}, 30 | const {'1': 'granter', '3': 3, '4': 1, '5': 9, '10': 'granter'}, 31 | const {'1': 'grantee', '3': 4, '4': 1, '5': 9, '10': 'grantee'}, 32 | ], 33 | }; 34 | 35 | /// Descriptor for `EventRevoke`. Decode as a `google.protobuf.DescriptorProto`. 36 | final $typed_data.Uint8List eventRevokeDescriptor = $convert.base64Decode( 37 | 'CgtFdmVudFJldm9rZRIgCgxtc2dfdHlwZV91cmwYAiABKAlSCm1zZ1R5cGVVcmwSGAoHZ3JhbnRlchgDIAEoCVIHZ3JhbnRlchIYCgdncmFudGVlGAQgASgJUgdncmFudGVl'); 38 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_execution_by_recipe_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/handlers/get_execution_by_recipe_handler.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 7 | import 'package:pylons_sdk/src/features/models/execution_list_by_recipe_response.dart'; 8 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 9 | 10 | void main() { 11 | test('should complete the get execution by recipe handler future', () { 12 | initResponseCompleter(Strings.GET_EXECUTION_BY_RECIPE_ID); 13 | var sdkResponse = SDKIPCResponse( 14 | success: false, error: '', data: '', errorCode: '', action: ''); 15 | var handler = GetExecutionByRecipeHandler(); 16 | handler.handler(sdkResponse); 17 | expect(true, 18 | responseCompleters[Strings.GET_EXECUTION_BY_RECIPE_ID]!.isCompleted); 19 | }); 20 | 21 | test('should complete the get execution by recipe handler with data ', 22 | () async { 23 | initResponseCompleter(Strings.GET_EXECUTION_BY_RECIPE_ID); 24 | var sdkResponse = SDKIPCResponse( 25 | success: true, 26 | error: '', 27 | data: jsonEncode(ExecutionListByRecipeResponse.empty()), 28 | errorCode: '', 29 | action: ''); 30 | var handler = GetExecutionByRecipeHandler(); 31 | 32 | Future.delayed(Duration(seconds: 1), () { 33 | handler.handler(sdkResponse); 34 | expect(true, 35 | responseCompleters[Strings.GET_EXECUTION_BY_RECIPE_ID]!.isCompleted); 36 | }); 37 | 38 | var response = 39 | await responseCompleters[Strings.GET_EXECUTION_BY_RECIPE_ID]!.future; 40 | 41 | expect(true, response.success); 42 | expect(true, response.data is ExecutionListByRecipeResponse); 43 | }); 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/accounts.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/accounts.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use userMapDescriptor instead') 13 | const UserMap$json = const { 14 | '1': 'UserMap', 15 | '2': const [ 16 | const {'1': 'account_addr', '3': 1, '4': 1, '5': 9, '10': 'accountAddr'}, 17 | const {'1': 'username', '3': 2, '4': 1, '5': 9, '10': 'username'}, 18 | ], 19 | }; 20 | 21 | /// Descriptor for `UserMap`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List userMapDescriptor = $convert.base64Decode( 23 | 'CgdVc2VyTWFwEiEKDGFjY291bnRfYWRkchgBIAEoCVILYWNjb3VudEFkZHISGgoIdXNlcm5hbWUYAiABKAlSCHVzZXJuYW1l'); 24 | @$core.Deprecated('Use usernameDescriptor instead') 25 | const Username$json = const { 26 | '1': 'Username', 27 | '2': const [ 28 | const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'}, 29 | ], 30 | }; 31 | 32 | /// Descriptor for `Username`. Decode as a `google.protobuf.DescriptorProto`. 33 | final $typed_data.Uint8List usernameDescriptor = 34 | $convert.base64Decode('CghVc2VybmFtZRIUCgV2YWx1ZRgBIAEoCVIFdmFsdWU='); 35 | @$core.Deprecated('Use accountAddrDescriptor instead') 36 | const AccountAddr$json = const { 37 | '1': 'AccountAddr', 38 | '2': const [ 39 | const {'1': 'value', '3': 2, '4': 1, '5': 9, '10': 'value'}, 40 | ], 41 | }; 42 | 43 | /// Descriptor for `AccountAddr`. Decode as a `google.protobuf.DescriptorProto`. 44 | final $typed_data.Uint8List accountAddrDescriptor = 45 | $convert.base64Decode('CgtBY2NvdW50QWRkchIUCgV2YWx1ZRgCIAEoCVIFdmFsdWU='); 46 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/query/v1beta1/pagination.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/query/v1beta1/pagination.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use pageRequestDescriptor instead') 13 | const PageRequest$json = const { 14 | '1': 'PageRequest', 15 | '2': const [ 16 | const {'1': 'key', '3': 1, '4': 1, '5': 12, '10': 'key'}, 17 | const {'1': 'offset', '3': 2, '4': 1, '5': 4, '10': 'offset'}, 18 | const {'1': 'limit', '3': 3, '4': 1, '5': 4, '10': 'limit'}, 19 | const {'1': 'count_total', '3': 4, '4': 1, '5': 8, '10': 'countTotal'}, 20 | const {'1': 'reverse', '3': 5, '4': 1, '5': 8, '10': 'reverse'}, 21 | ], 22 | }; 23 | 24 | /// Descriptor for `PageRequest`. Decode as a `google.protobuf.DescriptorProto`. 25 | final $typed_data.Uint8List pageRequestDescriptor = $convert.base64Decode( 26 | 'CgtQYWdlUmVxdWVzdBIQCgNrZXkYASABKAxSA2tleRIWCgZvZmZzZXQYAiABKARSBm9mZnNldBIUCgVsaW1pdBgDIAEoBFIFbGltaXQSHwoLY291bnRfdG90YWwYBCABKAhSCmNvdW50VG90YWwSGAoHcmV2ZXJzZRgFIAEoCFIHcmV2ZXJzZQ=='); 27 | @$core.Deprecated('Use pageResponseDescriptor instead') 28 | const PageResponse$json = const { 29 | '1': 'PageResponse', 30 | '2': const [ 31 | const {'1': 'next_key', '3': 1, '4': 1, '5': 12, '10': 'nextKey'}, 32 | const {'1': 'total', '3': 2, '4': 1, '5': 4, '10': 'total'}, 33 | ], 34 | }; 35 | 36 | /// Descriptor for `PageResponse`. Decode as a `google.protobuf.DescriptorProto`. 37 | final $typed_data.Uint8List pageResponseDescriptor = $convert.base64Decode( 38 | 'CgxQYWdlUmVzcG9uc2USGQoIbmV4dF9rZXkYASABKAxSB25leHRLZXkSFAoFdG90YWwYAiABKARSBXRvdGFs'); 39 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/authz.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/authz.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use genericAuthorizationDescriptor instead') 13 | const GenericAuthorization$json = const { 14 | '1': 'GenericAuthorization', 15 | '2': const [ 16 | const {'1': 'msg', '3': 1, '4': 1, '5': 9, '10': 'msg'}, 17 | ], 18 | '7': const {}, 19 | }; 20 | 21 | /// Descriptor for `GenericAuthorization`. Decode as a `google.protobuf.DescriptorProto`. 22 | final $typed_data.Uint8List genericAuthorizationDescriptor = $convert.base64Decode( 23 | 'ChRHZW5lcmljQXV0aG9yaXphdGlvbhIQCgNtc2cYASABKAlSA21zZzoRyrQtDUF1dGhvcml6YXRpb24='); 24 | @$core.Deprecated('Use grantDescriptor instead') 25 | const Grant$json = const { 26 | '1': 'Grant', 27 | '2': const [ 28 | const { 29 | '1': 'authorization', 30 | '3': 1, 31 | '4': 1, 32 | '5': 11, 33 | '6': '.google.protobuf.Any', 34 | '8': const {}, 35 | '10': 'authorization' 36 | }, 37 | const { 38 | '1': 'expiration', 39 | '3': 2, 40 | '4': 1, 41 | '5': 11, 42 | '6': '.google.protobuf.Timestamp', 43 | '8': const {}, 44 | '10': 'expiration' 45 | }, 46 | ], 47 | }; 48 | 49 | /// Descriptor for `Grant`. Decode as a `google.protobuf.DescriptorProto`. 50 | final $typed_data.Uint8List grantDescriptor = $convert.base64Decode( 51 | 'CgVHcmFudBJNCg1hdXRob3JpemF0aW9uGAEgASgLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUIRyrQtDUF1dGhvcml6YXRpb25SDWF1dGhvcml6YXRpb24SRAoKZXhwaXJhdGlvbhgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXBCCJDfHwHI3h8AUgpleHBpcmF0aW9u'); 52 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/tx.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/tx.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:async' as $async; 9 | 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | import 'dart:core' as $core; 13 | import 'tx.pb.dart' as $5; 14 | import 'tx.pbjson.dart'; 15 | 16 | export 'tx.pb.dart'; 17 | 18 | abstract class MsgServiceBase extends $pb.GeneratedService { 19 | $async.Future<$5.MsgGrantResponse> grant( 20 | $pb.ServerContext ctx, $5.MsgGrant request); 21 | $async.Future<$5.MsgExecResponse> exec( 22 | $pb.ServerContext ctx, $5.MsgExec request); 23 | $async.Future<$5.MsgRevokeResponse> revoke( 24 | $pb.ServerContext ctx, $5.MsgRevoke request); 25 | 26 | $pb.GeneratedMessage createRequest($core.String method) { 27 | switch (method) { 28 | case 'Grant': 29 | return $5.MsgGrant(); 30 | case 'Exec': 31 | return $5.MsgExec(); 32 | case 'Revoke': 33 | return $5.MsgRevoke(); 34 | default: 35 | throw $core.ArgumentError('Unknown method: $method'); 36 | } 37 | } 38 | 39 | $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, 40 | $core.String method, $pb.GeneratedMessage request) { 41 | switch (method) { 42 | case 'Grant': 43 | return this.grant(ctx, request as $5.MsgGrant); 44 | case 'Exec': 45 | return this.exec(ctx, request as $5.MsgExec); 46 | case 'Revoke': 47 | return this.revoke(ctx, request as $5.MsgRevoke); 48 | default: 49 | throw $core.ArgumentError('Unknown method: $method'); 50 | } 51 | } 52 | 53 | $core.Map<$core.String, $core.dynamic> get $json => MsgServiceBase$json; 54 | $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> 55 | get $messageJson => MsgServiceBase$messageJson; 56 | } 57 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | com.pylons.example 28 | CFBundleURLSchemes 29 | 30 | pylons-example 31 | 32 | 33 | 34 | LSApplicationQueriesSchemes 35 | 36 | pylons-wallet 37 | 38 | CFBundleVersion 39 | $(FLUTTER_BUILD_NUMBER) 40 | 41 | LSRequiresIPhoneOS 42 | 43 | UILaunchStoryboardName 44 | LaunchScreen 45 | UIMainStoryboardFile 46 | Main 47 | UISupportedInterfaceOrientations 48 | 49 | UIInterfaceOrientationPortrait 50 | UIInterfaceOrientationLandscapeLeft 51 | UIInterfaceOrientationLandscapeRight 52 | 53 | UISupportedInterfaceOrientations~ipad 54 | 55 | UIInterfaceOrientationPortrait 56 | UIInterfaceOrientationPortraitUpsideDown 57 | UIInterfaceOrientationLandscapeLeft 58 | UIInterfaceOrientationLandscapeRight 59 | 60 | UIViewControllerBasedStatusBarAppearance 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 31 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.pylons.example" 47 | minSdkVersion 16 48 | targetSdkVersion 30 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /test_resources/recipe/recipe_from_node.json: -------------------------------------------------------------------------------- 1 | { 2 | "cookbookID": "cookbookLOUD", 3 | "ID": "LOUDGetCharacter123125", 4 | "name": "LOUD-Get-Character-Recipe", 5 | "description": "Creates a basic character in LOUD", 6 | "version": "v0.0.1", 7 | "coinInputs": [], 8 | "itemInputs": [], 9 | "entries": { 10 | "coinOutputs": [], 11 | "itemOutputs": [ 12 | { 13 | "ID": "basic_character_lv1", 14 | "doubles": [ 15 | { 16 | "key": "XP", 17 | "rate": "1.000000000000000000", 18 | "weightRanges": [], 19 | "program": "1" 20 | } 21 | ], 22 | "longs": [ 23 | { 24 | "key": "level", 25 | "rate": "1.000000000000000000", 26 | "weightRanges": [], 27 | "program": "1" 28 | }, 29 | { 30 | "key": "giantKills", 31 | "rate": "1.000000000000000000", 32 | "weightRanges": [], 33 | "program": "0" 34 | }, 35 | { 36 | "key": "special", 37 | "rate": "1.000000000000000000", 38 | "weightRanges": [], 39 | "program": "0" 40 | }, 41 | { 42 | "key": "specialDragonKill", 43 | "rate": "1.000000000000000000", 44 | "weightRanges": [], 45 | "program": "0" 46 | }, 47 | { 48 | "key": "undeadDragonKill", 49 | "rate": "1.000000000000000000", 50 | "weightRanges": [], 51 | "program": "0" 52 | } 53 | ], 54 | "strings": [ 55 | { 56 | "key": "entityType", 57 | "rate": "1.000000000000000000", 58 | "value": "character" 59 | } 60 | ], 61 | "mutableStrings": [], 62 | "transferFee": [], 63 | "tradePercentage": "0.100000000000000000", 64 | "tradeable": true 65 | } 66 | ], 67 | "itemModifyOutputs": [] 68 | }, 69 | "outputs": [ 70 | { 71 | "entryIDs": [ 72 | "basic_character_lv1" 73 | ], 74 | "weight": 1 75 | } 76 | ], 77 | "enabled": true, 78 | "extraInfo": "extraInfo" 79 | } -------------------------------------------------------------------------------- /test/src/features/core/error/exception_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/pylons_sdk.dart'; 3 | 4 | import '../../../../mocks/mock_constants.dart'; 5 | 6 | void main() { 7 | test('should create cookbook not owned exception ', () { 8 | var cookbookNotOwnedException = CookbookNotOwnedException( 9 | MOCK_COOKBOOK_ID, MOCK_RECIPE_ID, MOCK_ERR_CODE); 10 | expect(MOCK_COOKBOOK_ID, cookbookNotOwnedException.cookbook); 11 | expect(MOCK_RECIPE_ID, cookbookNotOwnedException.cbSender); 12 | expect(MOCK_ERR_CODE, cookbookNotOwnedException.errMsg); 13 | }); 14 | 15 | test('should create cookbook not owned exception ', () { 16 | var itemDoesntExists = ItemDoesNotExistException( 17 | MOCK_ITEM_ID, 18 | MOCK_ERR_CODE, 19 | ); 20 | expect(MOCK_ITEM_ID, itemDoesntExists.item); 21 | expect(MOCK_ERR_CODE, itemDoesntExists.errMsg); 22 | }); 23 | 24 | test('should create recipe doesnt exists exception ', () { 25 | var recipeDoesntExists = RecipeDoesNotExistException( 26 | MOCK_COOKBOOK_ID, MOCK_RECIPE_NAME, MOCK_ERR_CODE); 27 | expect(MOCK_COOKBOOK_ID, recipeDoesntExists.cookbook); 28 | expect(MOCK_RECIPE_NAME, recipeDoesntExists.recipeName); 29 | expect(true, recipeDoesntExists.recipeId.isEmpty); 30 | expect(MOCK_ERR_CODE, recipeDoesntExists.errMsg); 31 | }); 32 | 33 | test('should create recipe state exception exception ', () { 34 | var recipeDoesntExists = RecipeStateException( 35 | MOCK_COOKBOOK_ID, MOCK_RECIPE_NAME, MOCK_RECIPE_ID, MOCK_ERR_CODE); 36 | expect(MOCK_COOKBOOK_ID, recipeDoesntExists.cookbook); 37 | expect(MOCK_RECIPE_NAME, recipeDoesntExists.recipeName); 38 | expect(MOCK_RECIPE_ID, recipeDoesntExists.recipeId); 39 | expect(MOCK_ERR_CODE, recipeDoesntExists.errMsg); 40 | }); 41 | 42 | test('should create response exception', () { 43 | var responseException = ResponseException('', MOCK_ERR_CODE); 44 | expect(responseException.errMsg, MOCK_ERR_CODE); 45 | }); 46 | 47 | test('should create wallet initialization not done error', () { 48 | var responseException = WalletInitializationNotDone(MOCK_ERR_CODE); 49 | expect(responseException.errMsg, MOCK_ERR_CODE); 50 | }); 51 | } 52 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/auth/v1beta1/query.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/auth/v1beta1/query.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:async' as $async; 9 | 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | import 'dart:core' as $core; 13 | import 'query.pb.dart' as $3; 14 | import 'query.pbjson.dart'; 15 | 16 | export 'query.pb.dart'; 17 | 18 | abstract class QueryServiceBase extends $pb.GeneratedService { 19 | $async.Future<$3.QueryAccountsResponse> accounts( 20 | $pb.ServerContext ctx, $3.QueryAccountsRequest request); 21 | $async.Future<$3.QueryAccountResponse> account( 22 | $pb.ServerContext ctx, $3.QueryAccountRequest request); 23 | $async.Future<$3.QueryParamsResponse> params( 24 | $pb.ServerContext ctx, $3.QueryParamsRequest request); 25 | 26 | $pb.GeneratedMessage createRequest($core.String method) { 27 | switch (method) { 28 | case 'Accounts': 29 | return $3.QueryAccountsRequest(); 30 | case 'Account': 31 | return $3.QueryAccountRequest(); 32 | case 'Params': 33 | return $3.QueryParamsRequest(); 34 | default: 35 | throw $core.ArgumentError('Unknown method: $method'); 36 | } 37 | } 38 | 39 | $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, 40 | $core.String method, $pb.GeneratedMessage request) { 41 | switch (method) { 42 | case 'Accounts': 43 | return this.accounts(ctx, request as $3.QueryAccountsRequest); 44 | case 'Account': 45 | return this.account(ctx, request as $3.QueryAccountRequest); 46 | case 'Params': 47 | return this.params(ctx, request as $3.QueryParamsRequest); 48 | default: 49 | throw $core.ArgumentError('Unknown method: $method'); 50 | } 51 | } 52 | 53 | $core.Map<$core.String, $core.dynamic> get $json => QueryServiceBase$json; 54 | $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> 55 | get $messageJson => QueryServiceBase$messageJson; 56 | } 57 | -------------------------------------------------------------------------------- /test/src/features/ipc/ipc_handler_factory_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 3 | import 'package:pylons_sdk/src/features/ipc/ipc_handler_factory.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 5 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 6 | 7 | import '../../../mocks/mock_constants.dart'; 8 | 9 | void main() { 10 | test('Should complete completers when appropriate response arrives', () { 11 | _genericResponseTestFlow(Strings.TX_CREATE_COOKBOOK); 12 | _genericResponseTestFlow(Strings.TX_UPDATE_COOKBOOK); 13 | _genericResponseTestFlow(Strings.TX_CREATE_RECIPE); 14 | _genericResponseTestFlow(Strings.TX_UPDATE_RECIPE); 15 | _genericResponseTestFlow(Strings.TX_EXECUTE_RECIPE); 16 | _genericResponseTestFlow(Strings.GET_PROFILE); 17 | _genericResponseTestFlow(Strings.GET_EXECUTION_BY_ID); 18 | _genericResponseTestFlow(Strings.GET_ITEMS_BY_OWNER); 19 | }); 20 | 21 | test('should complete completer that needs handler', () { 22 | initResponseCompleter(Strings.GET_RECIPES); 23 | expect(false, responseCompleters[Strings.GET_RECIPES]!.isCompleted); 24 | var sdkResponse = SDKIPCResponse( 25 | success: true, 26 | error: '', 27 | data: [MOCK_RECIPE.toProto3Json()], 28 | errorCode: '', 29 | action: Strings.GET_RECIPES); 30 | IPCHandlerFactory.getHandler(sdkResponse); 31 | expect(true, responseCompleters[Strings.GET_RECIPES]!.isCompleted); 32 | }); 33 | 34 | test('should throw error if unknown key is found', () { 35 | var sdkResponse = SDKIPCResponse( 36 | success: true, 37 | error: '', 38 | data: [MOCK_RECIPE.toProto3Json()], 39 | errorCode: '', 40 | action: MOCK_USERNAME); 41 | expect(() => IPCHandlerFactory.getHandler(sdkResponse), 42 | throwsA(isA())); 43 | }); 44 | } 45 | 46 | void _genericResponseTestFlow(String key) { 47 | initResponseCompleter(key); 48 | expect(false, responseCompleters[key]!.isCompleted); 49 | var sdkResponse = SDKIPCResponse( 50 | success: true, error: '', data: '', errorCode: '', action: key); 51 | IPCHandlerFactory.getHandler(sdkResponse); 52 | expect(true, responseCompleters[key]!.isCompleted); 53 | } 54 | -------------------------------------------------------------------------------- /lib/src/features/ipc/ipc_handler_factory.dart: -------------------------------------------------------------------------------- 1 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 2 | import 'package:pylons_sdk/src/features/ipc/base/ipc_handler.dart'; 3 | import 'package:pylons_sdk/src/features/ipc/handlers/get_cookbooks_handler.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/handlers/get_execution_by_id_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/handlers/get_list_items_by_owner_handler.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/handlers/get_item_by_id_handler.dart'; 7 | import 'package:pylons_sdk/src/features/ipc/handlers/get_profile_handler.dart'; 8 | import 'package:pylons_sdk/src/features/ipc/handlers/get_recipe_handler.dart'; 9 | import 'package:pylons_sdk/src/features/ipc/handlers/get_recipes_handler.dart'; 10 | import 'package:pylons_sdk/src/features/ipc/handlers/get_trades_handler.dart'; 11 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 12 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 13 | 14 | import 'handlers/get_execution_by_recipe_handler.dart'; 15 | 16 | class IPCHandlerFactory { 17 | static final Map handlers = { 18 | Strings.GET_COOKBOOK: GetCookbooksHandler(), 19 | Strings.GET_RECIPES: GetRecipesHandler(), 20 | Strings.GET_RECIPE: GetRecipeHandler(), 21 | Strings.GET_EXECUTION_BY_RECIPE_ID: GetExecutionByRecipeHandler(), 22 | Strings.GET_ITEMS_BY_OWNER: GetListItemsByOwnerHandler(), 23 | Strings.GET_ITEM_BY_ID: GetItemByIdHandler(), 24 | Strings.GET_EXECUTION_BY_ID: GetExecutionByIdHandler(), 25 | Strings.GET_TRADES: GetTradesHandler(), 26 | Strings.GET_PROFILE: GetProfileHandler(), 27 | }; 28 | 29 | /// Fetches and resolves appropriate [IPCHandler] instance for [sdkIpcResponse], or completes 30 | /// the completer if no specific handler is set. 31 | static void getHandler(SDKIPCResponse sdkipcResponse) { 32 | print(sdkipcResponse); 33 | if (!responseCompleters.containsKey(sdkipcResponse.action)) { 34 | throw Exception( 35 | 'Unexpected response for unsent message of type ${sdkipcResponse.action}'); 36 | } 37 | if (handlers.containsKey(sdkipcResponse.action)) { 38 | handlers[sdkipcResponse.action]!.handler(sdkipcResponse); 39 | } else { 40 | responseCompleters[sdkipcResponse.action]!.complete(sdkipcResponse); 41 | } 42 | return; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/src/generated/pylons/redeem_info.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: pylons/pylons/redeem_info.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use redeemInfoDescriptor instead') 13 | const RedeemInfo$json = const { 14 | '1': 'RedeemInfo', 15 | '2': const [ 16 | const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'}, 17 | const { 18 | '1': 'processor_name', 19 | '3': 2, 20 | '4': 1, 21 | '5': 9, 22 | '10': 'processorName' 23 | }, 24 | const {'1': 'address', '3': 3, '4': 1, '5': 9, '10': 'address'}, 25 | const { 26 | '1': 'amount', 27 | '3': 4, 28 | '4': 1, 29 | '5': 9, 30 | '8': const {}, 31 | '10': 'amount' 32 | }, 33 | const {'1': 'signature', '3': 5, '4': 1, '5': 9, '10': 'signature'}, 34 | ], 35 | }; 36 | 37 | /// Descriptor for `RedeemInfo`. Decode as a `google.protobuf.DescriptorProto`. 38 | final $typed_data.Uint8List redeemInfoDescriptor = $convert.base64Decode( 39 | 'CgpSZWRlZW1JbmZvEg4KAmlkGAEgASgJUgJpZBIlCg5wcm9jZXNzb3JfbmFtZRgCIAEoCVINcHJvY2Vzc29yTmFtZRIYCgdhZGRyZXNzGAMgASgJUgdhZGRyZXNzEkYKBmFtb3VudBgEIAEoCUIuyN4fANreHyZnaXRodWIuY29tL2Nvc21vcy9jb3Ntb3Mtc2RrL3R5cGVzLkludFIGYW1vdW50EhwKCXNpZ25hdHVyZRgFIAEoCVIJc2lnbmF0dXJl'); 40 | @$core.Deprecated('Use createPaymentAccountDescriptor instead') 41 | const CreatePaymentAccount$json = const { 42 | '1': 'CreatePaymentAccount', 43 | '2': const [ 44 | const {'1': 'address', '3': 1, '4': 1, '5': 9, '10': 'address'}, 45 | const {'1': 'token', '3': 2, '4': 1, '5': 9, '10': 'token'}, 46 | const {'1': 'signature', '3': 3, '4': 1, '5': 9, '10': 'signature'}, 47 | ], 48 | }; 49 | 50 | /// Descriptor for `CreatePaymentAccount`. Decode as a `google.protobuf.DescriptorProto`. 51 | final $typed_data.Uint8List createPaymentAccountDescriptor = $convert.base64Decode( 52 | 'ChRDcmVhdGVQYXltZW50QWNjb3VudBIYCgdhZGRyZXNzGAEgASgJUgdhZGRyZXNzEhQKBXRva2VuGAIgASgJUgV0b2tlbhIcCglzaWduYXR1cmUYAyABKAlSCXNpZ25hdHVyZQ=='); 53 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_recipe_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:pylons_sdk/pylons_sdk.dart'; 5 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 6 | import 'package:pylons_sdk/src/features/ipc/handlers/get_recipe_handler.dart'; 7 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 8 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 9 | 10 | import '../../../../mocks/mock_constants.dart'; 11 | 12 | void main() { 13 | test('should complete the get recipe future', () { 14 | initResponseCompleter(Strings.GET_RECIPE); 15 | var sdkResponse = SDKIPCResponse( 16 | success: false, error: '', data: '', errorCode: '', action: ''); 17 | var handler = GetRecipeHandler(); 18 | handler.handler(sdkResponse); 19 | expect(true, responseCompleters[Strings.GET_RECIPE]!.isCompleted); 20 | }); 21 | 22 | test('should complete the get recipe future with data ', () async { 23 | initResponseCompleter(Strings.GET_RECIPE); 24 | var sdkResponse = SDKIPCResponse( 25 | success: true, 26 | error: '', 27 | data: jsonEncode(MOCK_RECIPE.toProto3Json()), 28 | errorCode: '', 29 | action: ''); 30 | var handler = GetRecipeHandler(); 31 | 32 | Future.delayed(Duration(seconds: 1), () { 33 | handler.handler(sdkResponse); 34 | expect(true, responseCompleters[Strings.GET_RECIPE]!.isCompleted); 35 | }); 36 | 37 | var response = await responseCompleters[Strings.GET_RECIPE]!.future; 38 | 39 | expect(true, response.success); 40 | expect(true, response.data is Recipe); 41 | }); 42 | 43 | test('should complete the get recipe future with error ', () async { 44 | initResponseCompleter(Strings.GET_RECIPE); 45 | var sdkResponse = SDKIPCResponse( 46 | success: true, 47 | error: '', 48 | data: '', // Will throw parsing error 49 | errorCode: '', 50 | action: ''); 51 | var handler = GetRecipeHandler(); 52 | 53 | Future.delayed(Duration(seconds: 1), () { 54 | handler.handler(sdkResponse); 55 | expect(true, responseCompleters[Strings.GET_RECIPE]!.isCompleted); 56 | }); 57 | 58 | var response = await responseCompleters[Strings.GET_RECIPE]!.future; 59 | expect(false, response.success); 60 | expect(Strings.ERR_MALFORMED_RECIPE, response.errorCode); 61 | }); 62 | } 63 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/authz/v1beta1/genesis.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/authz/v1beta1/genesis.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use genesisStateDescriptor instead') 13 | const GenesisState$json = const { 14 | '1': 'GenesisState', 15 | '2': const [ 16 | const { 17 | '1': 'authorization', 18 | '3': 1, 19 | '4': 3, 20 | '5': 11, 21 | '6': '.cosmos.authz.v1beta1.GrantAuthorization', 22 | '8': const {}, 23 | '10': 'authorization' 24 | }, 25 | ], 26 | }; 27 | 28 | /// Descriptor for `GenesisState`. Decode as a `google.protobuf.DescriptorProto`. 29 | final $typed_data.Uint8List genesisStateDescriptor = $convert.base64Decode( 30 | 'CgxHZW5lc2lzU3RhdGUSVAoNYXV0aG9yaXphdGlvbhgBIAMoCzIoLmNvc21vcy5hdXRoei52MWJldGExLkdyYW50QXV0aG9yaXphdGlvbkIEyN4fAFINYXV0aG9yaXphdGlvbg=='); 31 | @$core.Deprecated('Use grantAuthorizationDescriptor instead') 32 | const GrantAuthorization$json = const { 33 | '1': 'GrantAuthorization', 34 | '2': const [ 35 | const {'1': 'granter', '3': 1, '4': 1, '5': 9, '10': 'granter'}, 36 | const {'1': 'grantee', '3': 2, '4': 1, '5': 9, '10': 'grantee'}, 37 | const { 38 | '1': 'authorization', 39 | '3': 3, 40 | '4': 1, 41 | '5': 11, 42 | '6': '.google.protobuf.Any', 43 | '8': const {}, 44 | '10': 'authorization' 45 | }, 46 | const { 47 | '1': 'expiration', 48 | '3': 4, 49 | '4': 1, 50 | '5': 11, 51 | '6': '.google.protobuf.Timestamp', 52 | '8': const {}, 53 | '10': 'expiration' 54 | }, 55 | ], 56 | }; 57 | 58 | /// Descriptor for `GrantAuthorization`. Decode as a `google.protobuf.DescriptorProto`. 59 | final $typed_data.Uint8List grantAuthorizationDescriptor = $convert.base64Decode( 60 | 'ChJHcmFudEF1dGhvcml6YXRpb24SGAoHZ3JhbnRlchgBIAEoCVIHZ3JhbnRlchIYCgdncmFudGVlGAIgASgJUgdncmFudGVlEk0KDWF1dGhvcml6YXRpb24YAyABKAsyFC5nb29nbGUucHJvdG9idWYuQW55QhHKtC0NQXV0aG9yaXphdGlvblINYXV0aG9yaXphdGlvbhJECgpleHBpcmF0aW9uGAQgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcEIIyN4fAJDfHwFSCmV4cGlyYXRpb24='); 61 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/v1beta1/service.pbserver.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/v1beta1/service.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:async' as $async; 9 | 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | import 'dart:core' as $core; 13 | import 'service.pb.dart' as $8; 14 | import 'service.pbjson.dart'; 15 | 16 | export 'service.pb.dart'; 17 | 18 | abstract class ServiceBase extends $pb.GeneratedService { 19 | $async.Future<$8.SimulateResponse> simulate( 20 | $pb.ServerContext ctx, $8.SimulateRequest request); 21 | $async.Future<$8.GetTxResponse> getTx( 22 | $pb.ServerContext ctx, $8.GetTxRequest request); 23 | $async.Future<$8.BroadcastTxResponse> broadcastTx( 24 | $pb.ServerContext ctx, $8.BroadcastTxRequest request); 25 | $async.Future<$8.GetTxsEventResponse> getTxsEvent( 26 | $pb.ServerContext ctx, $8.GetTxsEventRequest request); 27 | 28 | $pb.GeneratedMessage createRequest($core.String method) { 29 | switch (method) { 30 | case 'Simulate': 31 | return $8.SimulateRequest(); 32 | case 'GetTx': 33 | return $8.GetTxRequest(); 34 | case 'BroadcastTx': 35 | return $8.BroadcastTxRequest(); 36 | case 'GetTxsEvent': 37 | return $8.GetTxsEventRequest(); 38 | default: 39 | throw $core.ArgumentError('Unknown method: $method'); 40 | } 41 | } 42 | 43 | $async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, 44 | $core.String method, $pb.GeneratedMessage request) { 45 | switch (method) { 46 | case 'Simulate': 47 | return this.simulate(ctx, request as $8.SimulateRequest); 48 | case 'GetTx': 49 | return this.getTx(ctx, request as $8.GetTxRequest); 50 | case 'BroadcastTx': 51 | return this.broadcastTx(ctx, request as $8.BroadcastTxRequest); 52 | case 'GetTxsEvent': 53 | return this.getTxsEvent(ctx, request as $8.GetTxsEventRequest); 54 | default: 55 | throw $core.ArgumentError('Unknown method: $method'); 56 | } 57 | } 58 | 59 | $core.Map<$core.String, $core.dynamic> get $json => ServiceBase$json; 60 | $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> 61 | get $messageJson => ServiceBase$messageJson; 62 | } 63 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_trades_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/pylons_sdk.dart'; 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/handlers/get_trades_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 7 | 8 | import '../../../../mocks/mock_constants.dart'; 9 | 10 | void main() { 11 | test('should complete the get trades future', () { 12 | initResponseCompleter(Strings.GET_TRADES); 13 | var sdkResponse = SDKIPCResponse( 14 | success: false, error: '', data: '', errorCode: '', action: ''); 15 | var handler = GetTradesHandler(); 16 | handler.handler(sdkResponse); 17 | expect(true, responseCompleters[Strings.GET_TRADES]!.isCompleted); 18 | }); 19 | 20 | test('should complete the get trades future with data ', () async { 21 | initResponseCompleter(Strings.GET_TRADES); 22 | var sdkResponse = SDKIPCResponse( 23 | success: true, 24 | error: '', 25 | data: [MOCK_TRADE.toProto3Json()], 26 | errorCode: '', 27 | action: ''); 28 | var handler = GetTradesHandler(); 29 | 30 | Future.delayed(Duration(seconds: 1), () { 31 | handler.handler(sdkResponse); 32 | expect(true, responseCompleters[Strings.GET_TRADES]!.isCompleted); 33 | }); 34 | 35 | var response = await responseCompleters[Strings.GET_TRADES]!.future; 36 | expect(true, response.success); 37 | expect(true, response.data is List); 38 | expect(1, List.from(response.data).length); 39 | }); 40 | 41 | test('should complete the get trades future with error ', () async { 42 | initResponseCompleter(Strings.GET_TRADES); 43 | var sdkResponse = SDKIPCResponse( 44 | success: true, 45 | error: '', 46 | data: [ 47 | // Will throw parsing error 48 | Trade() 49 | ..createEmptyInstance() 50 | ..toProto3Json() 51 | ], 52 | errorCode: '', 53 | action: ''); 54 | var handler = GetTradesHandler(); 55 | 56 | Future.delayed(Duration(seconds: 1), () { 57 | handler.handler(sdkResponse); 58 | expect(true, responseCompleters[Strings.GET_TRADES]!.isCompleted); 59 | }); 60 | 61 | var response = await responseCompleters[Strings.GET_TRADES]!.future; 62 | expect(false, response.success); 63 | expect(Strings.ERR_MALFORMED_TRADES, response.errorCode); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /test/src/features/ipc/handlers/get_recipes_handler_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:pylons_sdk/pylons_sdk.dart'; 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | import 'package:pylons_sdk/src/features/ipc/handlers/get_recipes_handler.dart'; 5 | import 'package:pylons_sdk/src/features/ipc/responseCompleters.dart'; 6 | import 'package:pylons_sdk/src/features/models/sdk_ipc_response.dart'; 7 | 8 | import '../../../../mocks/mock_constants.dart'; 9 | 10 | void main() { 11 | test('should complete the get All recipe future', () { 12 | initResponseCompleter(Strings.GET_RECIPES); 13 | var sdkResponse = SDKIPCResponse( 14 | success: false, error: '', data: '', errorCode: '', action: ''); 15 | var handler = GetRecipesHandler(); 16 | handler.handler(sdkResponse); 17 | expect(true, responseCompleters[Strings.GET_RECIPES]!.isCompleted); 18 | }); 19 | 20 | test('should complete the get All recipe future with data ', () async { 21 | initResponseCompleter(Strings.GET_RECIPES); 22 | var sdkResponse = SDKIPCResponse( 23 | success: true, 24 | error: '', 25 | data: [MOCK_RECIPE.toProto3Json()], 26 | errorCode: '', 27 | action: ''); 28 | var handler = GetRecipesHandler(); 29 | 30 | Future.delayed(Duration(seconds: 1), () { 31 | handler.handler(sdkResponse); 32 | expect(true, responseCompleters[Strings.GET_RECIPES]!.isCompleted); 33 | }); 34 | 35 | var response = await responseCompleters[Strings.GET_RECIPES]!.future; 36 | expect(true, response.success); 37 | expect(true, response.data is List); 38 | expect(1, List.from(response.data).length); 39 | }); 40 | 41 | test('should complete the get All recipe future with error ', () async { 42 | initResponseCompleter(Strings.GET_RECIPES); 43 | var sdkResponse = SDKIPCResponse( 44 | success: true, 45 | error: '', 46 | data: [ 47 | // Will throw parsing error 48 | Recipe() 49 | ..createEmptyInstance() 50 | ..toProto3Json() 51 | ], 52 | errorCode: '', 53 | action: ''); 54 | var handler = GetRecipesHandler(); 55 | 56 | Future.delayed(Duration(seconds: 1), () { 57 | handler.handler(sdkResponse); 58 | expect(true, responseCompleters[Strings.GET_RECIPES]!.isCompleted); 59 | }); 60 | 61 | var response = await responseCompleters[Strings.GET_RECIPES]!.future; 62 | expect(false, response.success); 63 | expect(Strings.ERR_MALFORMED_RECIPES, response.errorCode); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/base/v1beta1/coin.pbjson.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/base/v1beta1/coin.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package 7 | 8 | import 'dart:core' as $core; 9 | import 'dart:convert' as $convert; 10 | import 'dart:typed_data' as $typed_data; 11 | 12 | @$core.Deprecated('Use coinDescriptor instead') 13 | const Coin$json = const { 14 | '1': 'Coin', 15 | '2': const [ 16 | const {'1': 'denom', '3': 1, '4': 1, '5': 9, '10': 'denom'}, 17 | const { 18 | '1': 'amount', 19 | '3': 2, 20 | '4': 1, 21 | '5': 9, 22 | '8': const {}, 23 | '10': 'amount' 24 | }, 25 | ], 26 | '7': const {}, 27 | }; 28 | 29 | /// Descriptor for `Coin`. Decode as a `google.protobuf.DescriptorProto`. 30 | final $typed_data.Uint8List coinDescriptor = $convert.base64Decode( 31 | 'CgRDb2luEhQKBWRlbm9tGAEgASgJUgVkZW5vbRIjCgZhbW91bnQYAiABKAlCC9reHwNJbnTI3h8AUgZhbW91bnQ6BOigHwE='); 32 | @$core.Deprecated('Use decCoinDescriptor instead') 33 | const DecCoin$json = const { 34 | '1': 'DecCoin', 35 | '2': const [ 36 | const {'1': 'denom', '3': 1, '4': 1, '5': 9, '10': 'denom'}, 37 | const { 38 | '1': 'amount', 39 | '3': 2, 40 | '4': 1, 41 | '5': 9, 42 | '8': const {}, 43 | '10': 'amount' 44 | }, 45 | ], 46 | '7': const {}, 47 | }; 48 | 49 | /// Descriptor for `DecCoin`. Decode as a `google.protobuf.DescriptorProto`. 50 | final $typed_data.Uint8List decCoinDescriptor = $convert.base64Decode( 51 | 'CgdEZWNDb2luEhQKBWRlbm9tGAEgASgJUgVkZW5vbRIjCgZhbW91bnQYAiABKAlCC9reHwNEZWPI3h8AUgZhbW91bnQ6BOigHwE='); 52 | @$core.Deprecated('Use intProtoDescriptor instead') 53 | const IntProto$json = const { 54 | '1': 'IntProto', 55 | '2': const [ 56 | const {'1': 'int', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'int'}, 57 | ], 58 | }; 59 | 60 | /// Descriptor for `IntProto`. Decode as a `google.protobuf.DescriptorProto`. 61 | final $typed_data.Uint8List intProtoDescriptor = $convert 62 | .base64Decode('CghJbnRQcm90bxIdCgNpbnQYASABKAlCC9reHwNJbnTI3h8AUgNpbnQ='); 63 | @$core.Deprecated('Use decProtoDescriptor instead') 64 | const DecProto$json = const { 65 | '1': 'DecProto', 66 | '2': const [ 67 | const {'1': 'dec', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'dec'}, 68 | ], 69 | }; 70 | 71 | /// Descriptor for `DecProto`. Decode as a `google.protobuf.DescriptorProto`. 72 | final $typed_data.Uint8List decProtoDescriptor = $convert 73 | .base64Decode('CghEZWNQcm90bxIdCgNkZWMYASABKAlCC9reHwNEZWPI3h8AUgNkZWM='); 74 | -------------------------------------------------------------------------------- /lib/src/features/validations/validate_recipe.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:pylons_sdk/src/core/constants/strings.dart'; 4 | 5 | import '../../../pylons_sdk.dart'; 6 | 7 | class ValidateRecipe { 8 | /// Verifies that all of a recipe's outputs are accessible, and that it 9 | /// doesn't refer to any outputs that are not present. 10 | static void validate(Recipe recipe) { 11 | if (recipe.name.length <= kRecipeNameLength) { 12 | throwError(recipe, 'Recipe name should have more than 8 characters'); 13 | } 14 | 15 | if (recipe.cookbookId.isEmpty) { 16 | throwError(recipe, 'Invalid CookbookId'); 17 | } 18 | 19 | if (recipe.id.isEmpty) { 20 | throwError(recipe, 'Invalid Recipe ID'); 21 | } 22 | 23 | if (recipe.itemInputs 24 | .where((recipe) => recipe.id.isEmpty) 25 | .toList() 26 | .isNotEmpty) { 27 | throwError(recipe, 'Invalid Item ID'); 28 | } 29 | 30 | if (costPerBlockIsEmpty(recipe)) { 31 | throwError(recipe, 'Cost Per Block is Empty'); 32 | } 33 | 34 | var found = []; 35 | var reFound = []; 36 | var orphanOutputs = []; 37 | var unknownOutputs = []; 38 | for (var output in recipe.outputs) { 39 | for (var entry in output.entryIds) { 40 | if (!found.contains(entry)) found.add(entry); 41 | } 42 | } 43 | for (var entryId in found) { 44 | for (var output in recipe.entries.coinOutputs) { 45 | if (found.contains(output.id) && !reFound.contains(output.id)) { 46 | reFound.add(output.id); 47 | } else { 48 | orphanOutputs.add(output.id); 49 | } 50 | } 51 | for (var output in recipe.entries.itemOutputs) { 52 | if (found.contains(output.id) && !reFound.contains(output.id)) { 53 | reFound.add(output.id); 54 | } else { 55 | orphanOutputs.add(output.id); 56 | } 57 | } 58 | if (!reFound.contains(entryId)) unknownOutputs.add(entryId); 59 | } 60 | if (unknownOutputs.isNotEmpty || orphanOutputs.isNotEmpty) { 61 | throw RecipeValidationException( 62 | recipe.cookbookId, 63 | recipe.name, 64 | recipe.id, 65 | 'Recipe validation failed\nUnknown entry ids:\n\n' 66 | '${const JsonEncoder().convert(unknownOutputs)}\n\n' 67 | 'Orphaned entries:\n\n' 68 | '${const JsonEncoder().convert(orphanOutputs)}'); 69 | } 70 | } 71 | 72 | static bool costPerBlockIsEmpty(Recipe recipe) => 73 | !(recipe.costPerBlock.hasAmount() && recipe.costPerBlock.hasDenom()); 74 | 75 | static void throwError(Recipe recipe, String error) { 76 | throw RecipeValidationException( 77 | recipe.cookbookId, recipe.name, recipe.id, error); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /test/src/features/data/models/recipe_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | group('JSON deserialization tests', () {}); 5 | // group('JSON serialization tests', () { 6 | // test('Recipe JSON from remote deserializes correctly', () { 7 | // throw UnimplementedError(); 8 | // }); 9 | // test('CoinInput deserializes correctly', () { 10 | // throw UnimplementedError(); 11 | // }); 12 | // test('ItemInput deserializes correctly', () { 13 | // throw UnimplementedError(); 14 | // }); 15 | // test('CoinOutput deserializes correctly', () { 16 | // throw UnimplementedError(); 17 | // }); 18 | // test('ItemModifyOutput deserializes correctly', () { 19 | // throw UnimplementedError(); 20 | // }); 21 | // test('ItemOutput deserializes correctly', () { 22 | // throw UnimplementedError(); 23 | // }); 24 | // test('WeightedOutput deserializes correctly', () { 25 | // throw UnimplementedError(); 26 | // }); 27 | // test('EntriesList deserializes correctly', () { 28 | // throw UnimplementedError(); 29 | // }); 30 | // test('FeeInputParam deserializes correctly', () { 31 | // throw UnimplementedError(); 32 | // }); 33 | // }); 34 | group('Weblink tests', () { 35 | test('When generateWebLink called, web link is generated', () async { 36 | //expect(testRecipe.generateWebLink(), equals('TO DO - DeepLink'), 37 | // skip: true); 38 | }); 39 | test('When generateWebLink fails: , ____ exception returned', () async { 40 | //expect(() => testRecipe.generateWebLink(), throwsA(Exception()), 41 | // skip: true); 42 | }); 43 | }); 44 | 45 | test('Test Coin Input from Json', () async { 46 | // var jsonRaw = '{"coin": "pylons", "count": 2}'; 47 | //Map jsonMap = jsonDecode(jsonRaw); 48 | //var testCoinInputFromJson = CoinInput.fromJson(jsonMap); 49 | //expect(testCoinInputFromJson.coin, equals('pylons')); 50 | //expect(testCoinInputFromJson.count, equals(2)); 51 | }); 52 | 53 | test('Test Item Input', () async { 54 | // var jsonRaw = 55 | // '{"id": "testItem", "conditions": {"doubles": {}, "longs":{}, "strings": {}}, "doubles": {}, "longs":{}, "strings": {}, "transferFee":{}}'; 56 | // var jsonMap = Map.from(json.decode(jsonRaw)); 57 | //var testItemInputFromJson = await ItemInput.fromJson(jsonMap); 58 | //expect(testItemInputFromJson.id, equals('testItem')); 59 | //expect(testItemInputFromJson.conditions.runtimeType, equals(ConditionList)); 60 | //expect(testItemInputFromJson.transferFee.runtimeType, equals(FeeInputParam)); 61 | //expect(testItemInputFromJson.doubles.length, equals(0)); 62 | //expect(testItemInputFromJson.longs.length, equals(0)); 63 | //expect(testItemInputFromJson.strings.length, equals(0)); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /doc/02_cookbooks.md: -------------------------------------------------------------------------------- 1 | 4 | 5 | # Creating the cookbook 6 | 7 | When you want to develop on Pylons, the first step is always to create a cookbook. Cookbooks are the "containers" of a set of recipes, typically grouped together for a particular experience. A visual NFT artist will be creating many recipes to mint new image NFTs or a game will contain many recipes that together build the full experience. In both of these cases, all of the recipes would be contained within a single cookbook. 8 |
9 | Let's start by creating the following cookbook: 10 | 11 | ``` 12 | { 13 | "creator": "pylo1vn4p3v0u7l3c6jqup5j8fmhxnfumzl2094gtrc", 14 | "ID": "cookbookLOUD", 15 | "name": "Legend of the Undead Dragon", 16 | "description": "Cookbook for running pylons game experience LOUD", 17 | "developer": "Pylons Inc", 18 | "version": "v0.0.1", 19 | "supportEmail": "test@email.xyz", 20 | "enabled": true 21 | } 22 | ``` 23 | 24 |
25 | - The "creator" is the string bech32 string of the Pylons address for the owner / creator of the cookbook. Ownership of cookbooks can change via the transfer-cookbook transaction. 26 |
27 | - The "ID" is the unique identifier string of the cookbook. This is currently chosen by the developer when creating the cookbook. 28 |
29 | - The "name", "description", "version" and "supportEmail" strings are additional metadata fields that the can provide users and apps with more details about the experience. 30 |
31 | - The "version" is the string form of the cookbook's semantic version. If the cookbook is updated, this version string MUST also be increased. 32 |
33 | - The "enabled" field is a boolean to enable or disable the cookbook's functionality. If a cookbook is disabled, new recipes cannot be minted from it and existing recipes will no longer be able to be executed. 34 |
35 |
36 | Let’s create a cookbook in Dart. Create a new Cookbook variable by importing from the SDK. Structure the variable like the following: 37 | 38 | ``` 39 | var cookBook1 = Cookbook( 40 | creator: "", 41 | iD: cookBookId, 42 | name: "Cookbook Documentation test", 43 | description: "Cookbook for testing the documentation", 44 | developer: "Pylons Inc", 45 | version: "v0.0.1", 46 | supportEmail: "mijolaewright@pylons.tech", 47 | enabled: true 48 | ); 49 | ``` 50 | 51 | We can see that the fields follow what we detailed earlier. Be creative and make your cookbook fancy! 52 | 53 | After that we can simply execute on the chain. Store your response in a variable. 54 | 55 | ``` 56 | var response = await PylonsWallet.instance.txCreateCookbook(cookBook1); 57 | ``` 58 | 59 | From there we can use response.success to see if our cookbook creation was successful! 60 | 61 | Note that a cookbook can only be created once, so be sure to add the proper code logic to keep this action from happening more than once! 62 | -------------------------------------------------------------------------------- /lib/src/generated/cosmos/tx/v1beta1/service.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: cosmos/tx/v1beta1/service.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | 8 | // ignore_for_file: UNDEFINED_SHOWN_NAME 9 | import 'dart:core' as $core; 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | class OrderBy extends $pb.ProtobufEnum { 13 | static const OrderBy ORDER_BY_UNSPECIFIED = OrderBy._( 14 | 0, 15 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 16 | ? '' 17 | : 'ORDER_BY_UNSPECIFIED'); 18 | static const OrderBy ORDER_BY_ASC = OrderBy._( 19 | 1, 20 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 21 | ? '' 22 | : 'ORDER_BY_ASC'); 23 | static const OrderBy ORDER_BY_DESC = OrderBy._( 24 | 2, 25 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 26 | ? '' 27 | : 'ORDER_BY_DESC'); 28 | 29 | static const $core.List values = [ 30 | ORDER_BY_UNSPECIFIED, 31 | ORDER_BY_ASC, 32 | ORDER_BY_DESC, 33 | ]; 34 | 35 | static final $core.Map<$core.int, OrderBy> _byValue = 36 | $pb.ProtobufEnum.initByValue(values); 37 | static OrderBy? valueOf($core.int value) => _byValue[value]; 38 | 39 | const OrderBy._($core.int v, $core.String n) : super(v, n); 40 | } 41 | 42 | class BroadcastMode extends $pb.ProtobufEnum { 43 | static const BroadcastMode BROADCAST_MODE_UNSPECIFIED = BroadcastMode._( 44 | 0, 45 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 46 | ? '' 47 | : 'BROADCAST_MODE_UNSPECIFIED'); 48 | static const BroadcastMode BROADCAST_MODE_BLOCK = BroadcastMode._( 49 | 1, 50 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 51 | ? '' 52 | : 'BROADCAST_MODE_BLOCK'); 53 | static const BroadcastMode BROADCAST_MODE_SYNC = BroadcastMode._( 54 | 2, 55 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 56 | ? '' 57 | : 'BROADCAST_MODE_SYNC'); 58 | static const BroadcastMode BROADCAST_MODE_ASYNC = BroadcastMode._( 59 | 3, 60 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 61 | ? '' 62 | : 'BROADCAST_MODE_ASYNC'); 63 | 64 | static const $core.List values = [ 65 | BROADCAST_MODE_UNSPECIFIED, 66 | BROADCAST_MODE_BLOCK, 67 | BROADCAST_MODE_SYNC, 68 | BROADCAST_MODE_ASYNC, 69 | ]; 70 | 71 | static final $core.Map<$core.int, BroadcastMode> _byValue = 72 | $pb.ProtobufEnum.initByValue(values); 73 | static BroadcastMode? valueOf($core.int value) => _byValue[value]; 74 | 75 | const BroadcastMode._($core.int v, $core.String n) : super(v, n); 76 | } 77 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 20 | 24 | 28 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 54 | 56 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /lib/src/generated/tendermint/types/types.pbenum.dart: -------------------------------------------------------------------------------- 1 | /// 2 | // Generated code. Do not modify. 3 | // source: tendermint/types/types.proto 4 | // 5 | // @dart = 2.12 6 | // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields 7 | 8 | // ignore_for_file: UNDEFINED_SHOWN_NAME 9 | import 'dart:core' as $core; 10 | import 'package:protobuf/protobuf.dart' as $pb; 11 | 12 | class BlockIDFlag extends $pb.ProtobufEnum { 13 | static const BlockIDFlag BLOCK_ID_FLAG_UNKNOWN = BlockIDFlag._( 14 | 0, 15 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 16 | ? '' 17 | : 'BLOCK_ID_FLAG_UNKNOWN'); 18 | static const BlockIDFlag BLOCK_ID_FLAG_ABSENT = BlockIDFlag._( 19 | 1, 20 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 21 | ? '' 22 | : 'BLOCK_ID_FLAG_ABSENT'); 23 | static const BlockIDFlag BLOCK_ID_FLAG_COMMIT = BlockIDFlag._( 24 | 2, 25 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 26 | ? '' 27 | : 'BLOCK_ID_FLAG_COMMIT'); 28 | static const BlockIDFlag BLOCK_ID_FLAG_NIL = BlockIDFlag._( 29 | 3, 30 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 31 | ? '' 32 | : 'BLOCK_ID_FLAG_NIL'); 33 | 34 | static const $core.List values = [ 35 | BLOCK_ID_FLAG_UNKNOWN, 36 | BLOCK_ID_FLAG_ABSENT, 37 | BLOCK_ID_FLAG_COMMIT, 38 | BLOCK_ID_FLAG_NIL, 39 | ]; 40 | 41 | static final $core.Map<$core.int, BlockIDFlag> _byValue = 42 | $pb.ProtobufEnum.initByValue(values); 43 | static BlockIDFlag? valueOf($core.int value) => _byValue[value]; 44 | 45 | const BlockIDFlag._($core.int v, $core.String n) : super(v, n); 46 | } 47 | 48 | class SignedMsgType extends $pb.ProtobufEnum { 49 | static const SignedMsgType SIGNED_MSG_TYPE_UNKNOWN = SignedMsgType._( 50 | 0, 51 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 52 | ? '' 53 | : 'SIGNED_MSG_TYPE_UNKNOWN'); 54 | static const SignedMsgType SIGNED_MSG_TYPE_PREVOTE = SignedMsgType._( 55 | 1, 56 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 57 | ? '' 58 | : 'SIGNED_MSG_TYPE_PREVOTE'); 59 | static const SignedMsgType SIGNED_MSG_TYPE_PRECOMMIT = SignedMsgType._( 60 | 2, 61 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 62 | ? '' 63 | : 'SIGNED_MSG_TYPE_PRECOMMIT'); 64 | static const SignedMsgType SIGNED_MSG_TYPE_PROPOSAL = SignedMsgType._( 65 | 32, 66 | const $core.bool.fromEnvironment('protobuf.omit_enum_names') 67 | ? '' 68 | : 'SIGNED_MSG_TYPE_PROPOSAL'); 69 | 70 | static const $core.List values = [ 71 | SIGNED_MSG_TYPE_UNKNOWN, 72 | SIGNED_MSG_TYPE_PREVOTE, 73 | SIGNED_MSG_TYPE_PRECOMMIT, 74 | SIGNED_MSG_TYPE_PROPOSAL, 75 | ]; 76 | 77 | static final $core.Map<$core.int, SignedMsgType> _byValue = 78 | $pb.ProtobufEnum.initByValue(values); 79 | static SignedMsgType? valueOf($core.int value) => _byValue[value]; 80 | 81 | const SignedMsgType._($core.int v, $core.String n) : super(v, n); 82 | } 83 | --------------------------------------------------------------------------------