├── packages ├── cosmos_auth │ ├── LICENSE │ ├── README.md │ ├── CHANGELOG.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── model │ │ │ ├── biometric_type.dart │ │ │ ├── save_password_failure.dart │ │ │ ├── local_auth_failure.dart │ │ │ └── read_password_failure.dart │ │ ├── cosmos_auth.dart │ │ └── biometrics │ │ │ └── biometrics.dart │ ├── pubspec.yaml │ ├── test │ │ └── mocks │ │ │ └── mocks.dart │ └── .gitignore ├── cosmos_lint │ ├── LICENSE │ ├── README.md │ ├── analysis_options.yaml │ ├── CHANGELOG.md │ ├── pubspec.lock │ ├── pubspec.yaml │ └── lib │ │ └── lint.dart ├── cosmos_utils │ ├── LICENSE │ ├── CHANGELOG.md │ ├── analysis_options.yaml │ ├── .fvm │ │ └── fvm_config.json │ ├── test │ │ ├── cosmos_utils_test.dart │ │ ├── address_hexing_test.dart │ │ ├── number_formatter_test.dart │ │ └── mnemonic_test.dart │ ├── lib │ │ ├── group_by_extension.dart │ │ ├── amount_formatter.dart │ │ ├── cosmos_utils.dart │ │ ├── credentials_storage_failure.dart │ │ ├── app_info_provider.dart │ │ ├── colors_generator.dart │ │ ├── not_implemented.dart │ │ ├── data_store.dart │ │ ├── logger.dart │ │ ├── future_either.dart │ │ ├── address_parser.dart │ │ ├── mnemonic.dart │ │ ├── extensions.dart │ │ └── app_info_extractor.dart │ ├── .metadata │ ├── README.md │ ├── pubspec.yaml │ └── .gitignore ├── cosmos_node_client │ ├── LICENSE │ ├── README.md │ ├── CHANGELOG.md │ ├── analysis_options.yaml │ ├── lib │ │ ├── cosmos_node_client.dart │ │ ├── account │ │ │ ├── account_derivation_failure.dart │ │ │ └── mnemonic.dart │ │ └── utils │ │ │ ├── utils.dart │ │ │ └── extensions.dart │ ├── test │ │ ├── cosmos_node_client_test.dart │ │ └── mnemonic_test.dart │ ├── .run │ │ └── All Tests.run.xml │ ├── pubspec.yaml │ └── .gitignore ├── cosmos_ui_components │ ├── LICENSE │ ├── analysis_options.yaml │ ├── .fvm │ │ └── fvm_config.json │ ├── fonts │ │ └── inter.ttf │ ├── assets │ │ └── images │ │ │ ├── more.png │ │ │ ├── check.png │ │ │ ├── cross.png │ │ │ ├── toggle.png │ │ │ ├── 2.0x │ │ │ ├── more.png │ │ │ ├── check.png │ │ │ ├── cross.png │ │ │ ├── toggle.png │ │ │ ├── arrow_right.png │ │ │ ├── big-arrow-left.png │ │ │ ├── icon_invalid.png │ │ │ ├── icon_warning.png │ │ │ ├── receive_icon.png │ │ │ ├── checkbox_checked.png │ │ │ └── checkbox_unchecked.png │ │ │ ├── 3.0x │ │ │ ├── more.png │ │ │ ├── check.png │ │ │ ├── cross.png │ │ │ ├── toggle.png │ │ │ ├── arrow_right.png │ │ │ ├── big-arrow-left.png │ │ │ ├── icon_invalid.png │ │ │ ├── icon_warning.png │ │ │ ├── receive_icon.png │ │ │ ├── checkbox_checked.png │ │ │ └── checkbox_unchecked.png │ │ │ ├── arrow_right.png │ │ │ ├── big-arrow-left.png │ │ │ ├── icon_invalid.png │ │ │ ├── icon_warning.png │ │ │ ├── receive_icon.png │ │ │ ├── checkbox_checked.png │ │ │ └── checkbox_unchecked.png │ ├── lib │ │ ├── fonts │ │ │ ├── Inter-Bold.ttf │ │ │ ├── Inter-Thin.ttf │ │ │ ├── Inter-Black.ttf │ │ │ ├── Inter-Light.ttf │ │ │ ├── Inter-Medium.ttf │ │ │ ├── Inter-Regular.ttf │ │ │ ├── Inter-ExtraBold.ttf │ │ │ ├── Inter-SemiBold.ttf │ │ │ └── Inter-ExtraLight.ttf │ │ ├── models │ │ │ ├── balance.dart │ │ │ └── account_info.dart │ │ ├── components │ │ │ ├── modals │ │ │ │ ├── platform_check.dart │ │ │ │ └── cosmos_modal_action.dart │ │ │ ├── cosmos_divider.dart │ │ │ ├── cosmos_token_avatar.dart │ │ │ ├── empty_list_message.dart │ │ │ ├── gradient_avatar.dart │ │ │ ├── content_loading_indicator.dart │ │ │ ├── template │ │ │ │ ├── transaction_history_group_title.dart │ │ │ │ ├── cosmos_balance_list_view.dart │ │ │ │ └── cosmos_balance_heading.dart │ │ │ ├── cosmos_app_bar_action.dart │ │ │ ├── cosmos_error_view.dart │ │ │ ├── cosmos_bottom_sheet_container.dart │ │ │ ├── minimal_bottom_spacer.dart │ │ │ ├── cosmos_qr_image.dart │ │ │ ├── cosmos_back_button.dart │ │ │ ├── app_version_text.dart │ │ │ ├── chip_text.dart │ │ │ ├── cosmos_image_button.dart │ │ │ ├── content_state_switcher.dart │ │ │ ├── info_card.dart │ │ │ └── cosmos_circle_text_button.dart │ │ └── utils │ │ │ ├── global_constants.dart │ │ │ ├── durations.dart │ │ │ └── date_formatter.dart │ ├── test │ │ ├── cosmos_ui_components_test.dart │ │ ├── screenshot_tests │ │ │ ├── goldens │ │ │ │ ├── ci │ │ │ │ │ └── cosmos_elevated_button.png │ │ │ │ └── macos │ │ │ │ │ └── cosmos_elevated_button.png │ │ │ ├── flutter_test_config.dart │ │ │ └── cosmos_elevated_button_test.dart │ │ └── test_utils │ │ │ └── golden_test_utils.dart │ ├── .idea │ │ ├── vcs.xml │ │ └── .gitignore │ ├── .metadata │ ├── README.md │ ├── CHANGELOG.md │ └── pubspec.yaml └── transaction_signing_gateway │ ├── LICENSE │ ├── lib │ ├── model │ │ ├── signed_transaction.dart │ │ ├── unsigned_transaction.dart │ │ ├── account_derivation_info.dart │ │ ├── private_account_credentials.dart │ │ ├── transaction_hash.dart │ │ ├── account_lookup_key.dart │ │ ├── clear_credentials_failure.dart │ │ ├── private_account_credentials_serializer.dart │ │ ├── transaction_log.dart │ │ ├── transaction_broadcasting_failure.dart │ │ ├── account_public_info_serializer.dart │ │ ├── account_derivation_failure.dart │ │ ├── transaction_signing_failure.dart │ │ └── account_public_info.dart │ ├── encrypt │ │ └── cipher.dart │ ├── alan │ │ ├── alan_account_derivation_info.dart │ │ ├── alan_transaction.dart │ │ └── alan_private_account_credentials.dart │ ├── mobile │ │ └── no_op_transaction_summary_ui.dart │ ├── transaction_summary_ui.dart │ ├── account_derivator.dart │ ├── transaction_broadcaster.dart │ ├── storage │ │ └── key_info_storage.dart │ ├── transaction_signer.dart │ └── transaction_signing_gateway.dart │ ├── analysis_options.yaml │ ├── .fvm │ └── fvm_config.json │ ├── test │ ├── mocks │ │ ├── key_info_storage_mock.dart │ │ ├── transaction_summary_ui_mock.dart │ │ ├── test_memory_store.dart │ │ └── stub_shared_preferences.dart │ ├── aes_cipher_test.dart │ ├── alan_credentials_serializer_test.dart │ ├── account_public_info_serializer_test.dart │ └── shared_prefs_plain_data_store_test.dart │ ├── .metadata │ ├── README.md │ ├── pubspec.yaml │ └── .gitignore ├── go.mod ├── starport_template ├── analysis_options.yaml ├── 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 │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ └── Main.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── fastlane │ │ ├── Pluginfile │ │ ├── Appfile │ │ └── README.md │ ├── Gemfile │ ├── Runner.xcodeproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Matchfile │ ├── .gitignore │ └── Podfile ├── .fvm │ └── fvm_config.json ├── 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 │ │ │ └── starport │ │ │ └── template │ │ │ └── MainActivity.kt │ ├── fastlane │ │ ├── Pluginfile │ │ ├── Appfile │ │ ├── README.md │ │ └── Fastfile │ ├── Gemfile │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── assets │ ├── images │ │ ├── share.png │ │ ├── face_id.png │ │ ├── settings.png │ │ ├── 2.0x │ │ │ ├── share.png │ │ │ ├── face_id.png │ │ │ ├── settings.png │ │ │ ├── arrow_right.png │ │ │ ├── plus_circle.png │ │ │ ├── check_circle.png │ │ │ ├── icon_check_16.png │ │ │ ├── icon_copy_16.png │ │ │ └── arrow_down_circle.png │ │ ├── 3.0x │ │ │ ├── share.png │ │ │ ├── face_id.png │ │ │ ├── settings.png │ │ │ ├── arrow_right.png │ │ │ ├── plus_circle.png │ │ │ ├── check_circle.png │ │ │ ├── icon_check_16.png │ │ │ ├── icon_copy_16.png │ │ │ └── arrow_down_circle.png │ │ ├── arrow_right.png │ │ ├── plus_circle.png │ │ ├── welcome-bg.png │ │ ├── check_circle.png │ │ ├── icon_check_16.png │ │ ├── icon_copy_16.png │ │ └── arrow_down_circle.png │ └── app_icon │ │ └── app_icon.png ├── test │ └── sample_test.dart ├── .idea │ └── vcs.xml ├── lib │ ├── utils │ │ ├── amount_validator.dart │ │ ├── node_info_loader.dart │ │ ├── cosmos_balances.dart │ │ └── token_sender.dart │ ├── stores │ │ ├── theme_store.dart │ │ └── transactions_store.dart │ ├── entities │ │ ├── msg_send_transaction.dart │ │ ├── import_account_form_data.dart │ │ ├── denom.dart │ │ ├── transaction_history_item.dart │ │ ├── amount.dart │ │ ├── balance.dart │ │ └── account_additional_data.dart │ ├── model │ │ ├── balance_json.dart │ │ ├── amount_json.dart │ │ ├── tx_body_json.dart │ │ ├── tx_json.dart │ │ ├── tx_response_json.dart │ │ └── tx_body_message_json.dart │ ├── widgets │ │ ├── starport_button_bar.dart │ │ ├── loading_splash.dart │ │ ├── back_up_account_card.dart │ │ ├── asset_portfolio_heading.dart │ │ ├── sign_transaction_tab_view_item.dart │ │ └── balance_card_list.dart │ ├── pages │ │ └── select_asset_page.dart │ ├── app_config.dart │ └── starport_app.dart └── .metadata ├── .vscode └── settings.json ├── .github └── ISSUE_TEMPLATE │ ├── feature.md │ ├── technical.md │ └── bug_report.md ├── .idea └── vcs.xml ├── flutter.go ├── .metadata └── .gitignore /packages/cosmos_auth/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /packages/cosmos_lint/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /packages/cosmos_utils/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/tendermint/flutter/v2 2 | 3 | go 1.16 4 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /packages/cosmos_lint/README.md: -------------------------------------------------------------------------------- 1 | # cosmos_lint 2 | 3 | Cosmos linter package -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/LICENSE: -------------------------------------------------------------------------------- 1 | TODO: Add your license here. 2 | -------------------------------------------------------------------------------- /packages/cosmos_auth/README.md: -------------------------------------------------------------------------------- 1 | # cosmos_auth 2 | 3 | Cosmos biometrics package 4 | -------------------------------------------------------------------------------- /packages/cosmos_lint/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: lib/analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/cosmos_auth/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /packages/cosmos_auth/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /packages/cosmos_lint/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/README.md: -------------------------------------------------------------------------------- 1 | # cosmos_node_client 2 | 3 | Cosmos node client 4 | -------------------------------------------------------------------------------- /packages/cosmos_utils/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /packages/cosmos_utils/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /starport_template/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "conventionalCommits.scopes": [ 3 | "fvm" 4 | ] 5 | } -------------------------------------------------------------------------------- /packages/cosmos_node_client/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /starport_template/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /packages/cosmos_ui_components/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/signed_transaction.dart: -------------------------------------------------------------------------------- 1 | class SignedTransaction {} 2 | -------------------------------------------------------------------------------- /starport_template/.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "2.10.5", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /packages/cosmos_utils/.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "2.10.5", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:cosmos_lint/analysis_options.yaml -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/unsigned_transaction.dart: -------------------------------------------------------------------------------- 1 | class UnsignedTransaction {} 2 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "2.10.5", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/.fvm/fvm_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "flutterSdkVersion": "2.10.5", 3 | "flavors": {} 4 | } -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/account_derivation_info.dart: -------------------------------------------------------------------------------- 1 | abstract class AccountDerivationInfo {} 2 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/model/biometric_type.dart: -------------------------------------------------------------------------------- 1 | enum BiometricType { 2 | face, 3 | fingerprint, 4 | iris, 5 | } 6 | -------------------------------------------------------------------------------- /starport_template/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /starport_template/assets/images/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/share.png -------------------------------------------------------------------------------- /starport_template/assets/images/face_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/face_id.png -------------------------------------------------------------------------------- /starport_template/assets/images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/settings.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/fonts/inter.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/fonts/inter.ttf -------------------------------------------------------------------------------- /starport_template/assets/app_icon/app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/app_icon/app_icon.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/share.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/share.png -------------------------------------------------------------------------------- /starport_template/assets/images/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/arrow_right.png -------------------------------------------------------------------------------- /starport_template/assets/images/plus_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/plus_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/welcome-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/welcome-bg.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/face_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/face_id.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/settings.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/face_id.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/face_id.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/settings.png -------------------------------------------------------------------------------- /starport_template/assets/images/check_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/check_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/icon_check_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/icon_check_16.png -------------------------------------------------------------------------------- /starport_template/assets/images/icon_copy_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/icon_copy_16.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/more.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/arrow_right.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/plus_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/plus_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/arrow_right.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/plus_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/plus_circle.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/check.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/cross.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/toggle.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Bold.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Thin.ttf -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/check_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/check_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/icon_check_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/icon_check_16.png -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/icon_copy_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/icon_copy_16.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/check_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/check_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/icon_check_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/icon_check_16.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/icon_copy_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/icon_copy_16.png -------------------------------------------------------------------------------- /starport_template/assets/images/arrow_down_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/arrow_down_circle.png -------------------------------------------------------------------------------- /starport_template/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /starport_template/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/more.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/more.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Black.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Light.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Medium.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-Regular.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/check.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/cross.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/toggle.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/check.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/cross.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/toggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/toggle.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/arrow_right.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-ExtraBold.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-SemiBold.ttf -------------------------------------------------------------------------------- /starport_template/assets/images/2.0x/arrow_down_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/2.0x/arrow_down_circle.png -------------------------------------------------------------------------------- /starport_template/assets/images/3.0x/arrow_down_circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/assets/images/3.0x/arrow_down_circle.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/big-arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/big-arrow-left.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/icon_invalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/icon_invalid.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/icon_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/icon_warning.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/receive_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/receive_icon.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/fonts/Inter-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/lib/fonts/Inter-ExtraLight.ttf -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/arrow_right.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/arrow_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/arrow_right.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/checkbox_checked.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/big-arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/big-arrow-left.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/icon_invalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/icon_invalid.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/icon_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/icon_warning.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/receive_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/receive_icon.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/big-arrow-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/big-arrow-left.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/icon_invalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/icon_invalid.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/icon_warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/icon_warning.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/receive_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/receive_icon.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/checkbox_unchecked.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature 3 | about: New feature 4 | title: "[Feature] " 5 | labels: "Feature \U0001F4A1" 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/technical.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Technical 3 | about: Technical task 4 | title: '' 5 | labels: "Technical \U0001F6E0" 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/checkbox_checked.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/checkbox_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/checkbox_checked.png -------------------------------------------------------------------------------- /starport_template/ios/fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-firebase_app_distribution' 6 | -------------------------------------------------------------------------------- /starport_template/test/sample_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('sample test', () { 5 | expect(true, isTrue); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /packages/cosmos_lint/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: {} 4 | sdks: 5 | dart: ">=2.14.0 <3.0.0" 6 | flutter: ">=1.17.0" 7 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/2.0x/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/2.0x/checkbox_unchecked.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/assets/images/3.0x/checkbox_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/assets/images/3.0x/checkbox_unchecked.png -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /starport_template/android/fastlane/Pluginfile: -------------------------------------------------------------------------------- 1 | # Autogenerated by fastlane 2 | # 3 | # Ensure this file is checked in to source control! 4 | 5 | gem 'fastlane-plugin-firebase_app_distribution' 6 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/cosmos_ui_components_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('sample test', () { 5 | expect(true, isTrue); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /packages/cosmos_utils/test/cosmos_utils_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('adds one to input values', () { 5 | expect(true, isTrue); 6 | }); 7 | } 8 | -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /starport_template/ios/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 5 | eval_gemfile(plugins_path) if File.exist?(plugins_path) 6 | -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/screenshot_tests/goldens/ci/cosmos_elevated_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/test/screenshot_tests/goldens/ci/cosmos_elevated_button.png -------------------------------------------------------------------------------- /starport_template/android/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "fastlane" 4 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') 5 | eval_gemfile(plugins_path) if File.exist?(plugins_path) 6 | -------------------------------------------------------------------------------- /starport_template/android/fastlane/Appfile: -------------------------------------------------------------------------------- 1 | json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one 2 | package_name("com.starport.template") # e.g. com.krausefx.app 3 | -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/starport_template/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/screenshot_tests/goldens/macos/cosmos_elevated_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tendermint/flutter/HEAD/packages/cosmos_ui_components/test/screenshot_tests/goldens/macos/cosmos_elevated_button.png -------------------------------------------------------------------------------- /starport_template/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/cosmos_lint/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cosmos_lint 2 | version: 1.9.0 3 | decription: Cosmos Linter 4 | homepage: ignite.com 5 | publish_to: 'none' # TODO publish it when ready 6 | 7 | environment: 8 | sdk: ">=2.14.0 <3.0.0" 9 | flutter: ">=1.17.0" -------------------------------------------------------------------------------- /packages/cosmos_ui_components/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/kotlin/com/starport/template/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.starport.template 2 | 3 | import io.flutter.embedding.android.FlutterFragmentActivity 4 | 5 | class MainActivity: FlutterFragmentActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/models/balance.dart: -------------------------------------------------------------------------------- 1 | class Balance { 2 | Balance({ 3 | required this.denomText, 4 | required this.amountDisplayText, 5 | }); 6 | 7 | final String denomText; 8 | final String amountDisplayText; 9 | } 10 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/mocks/key_info_storage_mock.dart: -------------------------------------------------------------------------------- 1 | import 'package:mocktail/mocktail.dart'; 2 | import 'package:transaction_signing_gateway/storage/key_info_storage.dart'; 3 | 4 | class KeyInfoStorageMock extends Mock implements KeyInfoStorage {} 5 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/mocks/transaction_summary_ui_mock.dart: -------------------------------------------------------------------------------- 1 | import 'package:mocktail/mocktail.dart'; 2 | import 'package:transaction_signing_gateway/transaction_summary_ui.dart'; 3 | 4 | class TransactionSummaryUIMock extends Mock implements TransactionSummaryUI {} 5 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/lib/cosmos_node_client.dart: -------------------------------------------------------------------------------- 1 | library cosmos_node_client; 2 | 3 | export 'package:cosmos_node_client/account/account.dart'; 4 | export 'package:cosmos_node_client/account/account_derivation_failure.dart'; 5 | export 'package:cosmos_node_client/account/mnemonic.dart'; 6 | -------------------------------------------------------------------------------- /starport_template/lib/utils/amount_validator.dart: -------------------------------------------------------------------------------- 1 | double validateAmount(String value) { 2 | if (value.isEmpty) { 3 | return 0; 4 | } 5 | final _amount = double.tryParse(value); 6 | if (_amount == null) { 7 | return 0; 8 | } else { 9 | return _amount; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/test/cosmos_node_client_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | test('demo test to be removed', () async { 5 | const two = 2; 6 | const three = 3; 7 | 8 | expect(two * three, equals(6)); 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/group_by_extension.dart: -------------------------------------------------------------------------------- 1 | extension Iterables on Iterable { 2 | Map> groupBy(K Function(E) keyFunction) => fold( 3 | >{}, 4 | (map, element) => map..putIfAbsent(keyFunction(element), () => []).add(element), 5 | ); 6 | } 7 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/models/account_info.dart: -------------------------------------------------------------------------------- 1 | class AccountInfo { 2 | AccountInfo({ 3 | required this.name, 4 | required this.address, 5 | required this.accountId, 6 | }); 7 | 8 | final String name; 9 | final String address; 10 | final String accountId; 11 | } 12 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/encrypt/cipher.dart: -------------------------------------------------------------------------------- 1 | abstract class Cipher { 2 | String encrypt({ 3 | required String password, 4 | required String data, 5 | }); 6 | 7 | String decrypt({ 8 | required String password, 9 | required String encryptedData, 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /starport_template/lib/stores/theme_store.dart: -------------------------------------------------------------------------------- 1 | import 'package:mobx/mobx.dart'; 2 | 3 | class ThemeStore { 4 | final Observable _isDarkTheme = Observable(false); 5 | 6 | bool get isDarkTheme => _isDarkTheme.value; 7 | 8 | set isDarkTheme(bool val) => Action(() => _isDarkTheme.value = val)(); 9 | } 10 | -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter.go: -------------------------------------------------------------------------------- 1 | package flutter 2 | 3 | import ( 4 | "embed" 5 | "io/fs" 6 | ) 7 | 8 | //go:embed starport_template/* starport_template/** 9 | var app embed.FS 10 | 11 | // Boilerplate is a flutter app starter for Cosmos SDK chains. 12 | func Boilerplate() fs.FS { 13 | f, _ := fs.Sub(app, "starport_template") 14 | return f 15 | } 16 | -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starport_template/lib/entities/msg_send_transaction.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/entities/amount.dart'; 2 | 3 | class MsgSendTransaction { 4 | MsgSendTransaction({required this.amount, required this.recipient, required this.fee}); 5 | 6 | final Amount amount; 7 | final String recipient; 8 | final double fee; 9 | } 10 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /starport_template/ios/Matchfile: -------------------------------------------------------------------------------- 1 | storage_mode("git") 2 | type("adhoc") 3 | git_url(ENV["MATCH_GIT_URL"]) 4 | team_id(ENV["MATCH_TEAM_ID"]) 5 | app_identifier(ENV["MATCH_APP_ID"]) 6 | username(ENV["MATCH_APPLE_USERNAME"]) 7 | 8 | # For all available options run `fastlane match --help` 9 | # The docs are available on https://docs.fastlane.tools/actions/match -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/modals/platform_check.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | enum OS { 4 | iOS, 5 | Android, 6 | Other, 7 | } 8 | 9 | typedef OSProvider = OS Function(); 10 | 11 | OS defaultOSProvider() => Platform.isIOS 12 | ? OS.iOS 13 | : Platform.isAndroid 14 | ? OS.Android 15 | : OS.Other; 16 | -------------------------------------------------------------------------------- /starport_template/lib/model/balance_json.dart: -------------------------------------------------------------------------------- 1 | class BalanceJson { 2 | BalanceJson({required this.denom, required this.amount}); 3 | 4 | BalanceJson.fromJson(Map json) { 5 | denom = json['denom'] as String; 6 | amount = json['amount'] as String; 7 | } 8 | 9 | late String denom; 10 | late String amount; 11 | } 12 | -------------------------------------------------------------------------------- /.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: 4d7946a68d26794349189cf21b3f68cc6fe61dcb 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/utils/global_constants.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | abstract class GlobalConstants { 4 | static const double defaultButtonHeight = 50; 5 | 6 | static const List cosmosGradientColors = [ 7 | Color(0xFF64DBFC), 8 | Color(0xFF30FFDF), 9 | Color(0xFFFFFE39), 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /starport_template/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /starport_template/.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: d79295af24c3ed621c33713ecda14ad196fd9c31 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: "bug \U0001F41B" 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Desription** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. 16 | 17 | **Expected behavior** 18 | 1. 19 | -------------------------------------------------------------------------------- /packages/cosmos_utils/.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: d79295af24c3ed621c33713ecda14ad196fd9c31 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/.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: d79295af24c3ed621c33713ecda14ad196fd9c31 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/.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: adc687823a831bbebe28bdccfac1a628ca621513 8 | channel: unknown 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/modals/cosmos_modal_action.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | class CosmosModalAction { 4 | const CosmosModalAction({ 5 | required this.text, 6 | required this.onPressed, 7 | this.isCriticalAction = false, 8 | }); 9 | 10 | final String text; 11 | final VoidCallback onPressed; 12 | final bool isCriticalAction; 13 | } 14 | -------------------------------------------------------------------------------- /starport_template/lib/model/amount_json.dart: -------------------------------------------------------------------------------- 1 | class AmountJson { 2 | AmountJson({ 3 | required this.denom, 4 | required this.amount, 5 | }); 6 | 7 | factory AmountJson.fromJson(Map json) => AmountJson( 8 | denom: json['denom'] as String? ?? '', 9 | amount: json['amount'] as String? ?? '', 10 | ); 11 | 12 | String denom; 13 | String amount; 14 | } 15 | -------------------------------------------------------------------------------- /starport_template/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. -------------------------------------------------------------------------------- /starport_template/ios/fastlane/Appfile: -------------------------------------------------------------------------------- 1 | app_identifier(ENV["MATCH_APP_ID"]) # The bundle identifier of your app 2 | apple_id(ENV["MATCH_APPLE_USERNAME"]) # Your Apple email address 3 | 4 | itc_team_id(ENV["MATCH_ITC_TEAM_ID"]) # App Store Connect Team ID 5 | team_id(ENV["MATCH_TEAM_ID"]) # Developer Portal Team ID 6 | 7 | # For more information about the Appfile, see: 8 | # https://docs.fastlane.tools/advanced/#appfile 9 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/.run/All Tests.run.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/amount_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | String formatAmount(double amount, {String locale = 'en_US', String symbol = r'$'}) => amount >= 10000 4 | ? NumberFormat.compactCurrency( 5 | symbol: symbol, 6 | locale: locale, 7 | ).format(amount) 8 | : NumberFormat.currency( 9 | locale: locale, 10 | symbol: symbol, 11 | ).format(amount); 12 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/private_account_credentials.dart: -------------------------------------------------------------------------------- 1 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 2 | 3 | abstract class PrivateAccountCredentials { 4 | AccountPublicInfo get publicInfo; 5 | 6 | String get mnemonic; 7 | 8 | /// needed to find a proper serializer that will deal with serializing/deserializing of theese credentials 9 | String get serializerIdentifier; 10 | } 11 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/cosmos_utils.dart: -------------------------------------------------------------------------------- 1 | library cosmos_utils; 2 | 3 | export 'address_parser.dart'; 4 | export 'app_info_provider.dart'; 5 | export 'colors_generator.dart'; 6 | export 'credentials_storage_failure.dart'; 7 | export 'data_store.dart'; 8 | export 'extensions.dart'; 9 | export 'future_either.dart'; 10 | export 'group_by_extension.dart'; 11 | export 'logger.dart'; 12 | export 'mnemonic.dart'; 13 | export 'not_implemented.dart'; 14 | -------------------------------------------------------------------------------- /starport_template/lib/model/tx_body_json.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/model/tx_body_message_json.dart'; 2 | 3 | class TxBodyJson { 4 | TxBodyJson({required this.messages}); 5 | 6 | factory TxBodyJson.fromJson(Map json) => TxBodyJson( 7 | messages: (json['messages'] as List).map((x) => TxBodyMessageJson.fromJson(x as Map)).toList(), 8 | ); 9 | 10 | List messages; 11 | } 12 | -------------------------------------------------------------------------------- /starport_template/lib/model/tx_json.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/model/tx_body_json.dart'; 2 | 3 | class TxJson { 4 | TxJson({ 5 | required this.type, 6 | required this.body, 7 | }); 8 | 9 | factory TxJson.fromJson(Map json) => TxJson( 10 | type: json['@type'] as String? ?? '', 11 | body: TxBodyJson.fromJson(json['body'] as Map), 12 | ); 13 | 14 | String type; 15 | TxBodyJson body; 16 | } 17 | -------------------------------------------------------------------------------- /packages/cosmos_utils/test/address_hexing_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test('bech32 to hex conversion', () { 6 | const address = 'cosmos1ygptsc84j7lezp6cvrjffu52520tla508qp4vk'; 7 | const expected = '2202b860f597bf91075860e494f28aa29ebff68f'; 8 | 9 | // ignore: deprecated_member_use_from_same_package 10 | expect(bech32ToHex(address), expected); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /starport_template/lib/entities/import_account_form_data.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/entities/account_additional_data.dart'; 2 | 3 | class ImportAccountFormData { 4 | const ImportAccountFormData({ 5 | required this.mnemonic, 6 | required this.name, 7 | required this.password, 8 | required this.additionalData, 9 | }); 10 | 11 | final String mnemonic; 12 | final String name; 13 | final String password; 14 | final AccountAdditionalData additionalData; 15 | } 16 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /packages/cosmos_lint/lib/lint.dart: -------------------------------------------------------------------------------- 1 | /// To enable `cosmos_lint`, 2 | /// 1. Add it to your dev_dependencies 3 | /// ```yaml 4 | /// dev_dependencies: 5 | /// cosmos_lint: 6 | /// git: 7 | /// url: https://github.com/tendermint/flutter.git 8 | /// path: packages/cosmos_lint 9 | /// ref: main 10 | /// ``` 11 | /// 12 | /// 2. Include the rules into your `analysis_options.yaml` 13 | /// ```yaml 14 | /// include: package:cosmos_lint/analysis_options.yaml 15 | /// ``` 16 | library lint; 17 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/model/save_password_failure.dart: -------------------------------------------------------------------------------- 1 | enum SavePasswordFailureType { 2 | Unknown, 3 | StorageFailure, 4 | } 5 | 6 | class SavePasswordFailure { 7 | const SavePasswordFailure.unknown([this.cause, this.stack]) : type = SavePasswordFailureType.Unknown; 8 | 9 | const SavePasswordFailure.storageFailure(this.cause, [this.stack]) : type = SavePasswordFailureType.StorageFailure; 10 | 11 | final SavePasswordFailureType type; 12 | final dynamic cause; 13 | final dynamic stack; 14 | } 15 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/credentials_storage_failure.dart: -------------------------------------------------------------------------------- 1 | class CredentialsStorageFailure { 2 | const CredentialsStorageFailure(this.message, {this.cause, this.stack}); 3 | 4 | final String message; 5 | final dynamic cause; 6 | 7 | final dynamic stack; 8 | 9 | @override 10 | String toString() { 11 | return 'CredentialsStorageFailure{message: $message' 12 | '${cause != null ? '\ncause: $cause' : ''}' 13 | '${stack != null ? '\nstack: $stack' : ''}' 14 | '}'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/transaction_hash.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class TransactionHash extends Equatable { 4 | const TransactionHash({required this.hash}); 5 | 6 | final String hash; 7 | 8 | @override 9 | List get props { 10 | return [ 11 | hash, 12 | ]; 13 | } 14 | 15 | TransactionHash copyWith({ 16 | String? hash, 17 | }) { 18 | return TransactionHash( 19 | hash: hash ?? this.hash, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/cosmos_utils/README.md: -------------------------------------------------------------------------------- 1 | # cosmos_utils 2 | 3 | Common utils package 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/utils/durations.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 2 | 3 | class LongDuration extends Duration { 4 | const LongDuration() : super(milliseconds: CosmosThemeData.defaultLongDuration); 5 | } 6 | 7 | class MediumDuration extends Duration { 8 | const MediumDuration() : super(milliseconds: CosmosThemeData.defaultMediumDuration); 9 | } 10 | 11 | class ShortDuration extends Duration { 12 | const ShortDuration() : super(milliseconds: CosmosThemeData.defaultShortDuration); 13 | } 14 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/account_lookup_key.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class AccountLookupKey extends Equatable { 4 | const AccountLookupKey({ 5 | required this.chainId, 6 | required this.accountId, 7 | required this.password, 8 | }); 9 | 10 | final String chainId; 11 | final String accountId; 12 | final String password; 13 | 14 | @override 15 | List get props => [ 16 | chainId, 17 | accountId, 18 | password, 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/README.md: -------------------------------------------------------------------------------- 1 | # cosmos_ui_components 2 | 3 | Cosmos UI componen ts 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Dart 8 | [package](https://flutter.dev/developing-packages/), 9 | a library module containing code that can be shared easily across 10 | multiple Flutter or Dart projects. 11 | 12 | For help getting started with Flutter, view our 13 | [online documentation](https://flutter.dev/docs), which offers tutorials, 14 | samples, guidance on mobile development, and a full API reference. 15 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/clear_credentials_failure.dart: -------------------------------------------------------------------------------- 1 | enum ClearCredentialsFailureType { 2 | Unknown, 3 | } 4 | 5 | class ClearCredentialsFailure { 6 | // ignore: avoid_field_initializers_in_const_classes 7 | const ClearCredentialsFailure.unknown([this.cause]) : type = ClearCredentialsFailureType.Unknown; 8 | 9 | final ClearCredentialsFailureType type; 10 | final dynamic cause; 11 | 12 | @override 13 | String toString() { 14 | return 'ClearCredentialsFailure{type: $type, cause: $cause}'; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/cosmos_auth.dart: -------------------------------------------------------------------------------- 1 | library cosmos_auth; 2 | 3 | export 'package:cosmos_auth/auth/cosmos_auth.dart'; 4 | export 'package:cosmos_auth/biometrics/biometrics.dart'; 5 | export 'package:cosmos_auth/model/biometric_type.dart'; 6 | export 'package:cosmos_auth/model/local_auth_failure.dart'; 7 | export 'package:cosmos_auth/model/read_password_failure.dart'; 8 | export 'package:cosmos_auth/model/save_password_failure.dart'; 9 | export 'package:cosmos_auth/model/save_password_failure.dart'; 10 | export 'package:cosmos_auth/store/password_store.dart'; 11 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /packages/cosmos_utils/test/number_formatter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/amount_formatter.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test('Amount formatter test case', () { 6 | expect(formatAmount(37570000000), r'$37.6B'); 7 | expect(formatAmount(10270, locale: 'pl', symbol: 'PLN'), '10,3 tys. PLN'); 8 | expect(formatAmount(1027.004921), r'$1,027.00'); 9 | expect(formatAmount(10000), r'$10K'); 10 | expect(formatAmount(9999), r'$9,999.00'); 11 | expect(formatAmount(1027), r'$1,027.00'); 12 | }); 13 | } 14 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/private_account_credentials_serializer.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:dartz/dartz.dart'; 3 | import 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 4 | 5 | abstract class PrivateAccountCredentialsSerializer { 6 | String get identifier; 7 | 8 | Either fromJson(Map json); 9 | 10 | Either> toJson(PrivateAccountCredentials credentials); 11 | } 12 | -------------------------------------------------------------------------------- /starport_template/lib/entities/denom.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/amount_formatter.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:starport_template/entities/amount.dart'; 4 | 5 | class Denom extends Equatable { 6 | const Denom( 7 | this.text, 8 | ); 9 | 10 | final String text; 11 | 12 | String amountWithDenomText(Amount amount) => '${formatAmount(amount.value.toDouble(), symbol: '')} $text'; 13 | 14 | @override 15 | List get props => [ 16 | text, 17 | ]; 18 | 19 | @override 20 | String toString() => text; 21 | } 22 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/app_info_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/app_info_extractor.dart'; 2 | 3 | class AppInfoProvider { 4 | Future get appInfo async { 5 | _appInfo ??= await getAppInfo(); 6 | return _appInfo!; 7 | } 8 | 9 | AppInfo? _appInfo; 10 | 11 | Future getAppVersion() async => (await appInfo).version; 12 | 13 | Future getAppName() async => (await appInfo).appName; 14 | 15 | Future getPackageName() async => (await appInfo).packageName; 16 | 17 | Future getBuildNumber() async => (await appInfo).buildNumber; 18 | } 19 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/colors_generator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/painting.dart'; 2 | 3 | List generateColorsFromAddress(String address) { 4 | final colors = hslTriad(address.hashCode % 360, 1, 0.5); 5 | 6 | return [ 7 | HSLColor.fromAHSL(1, colors[0][0], colors[0][1], colors[0][2]).toColor(), 8 | HSLColor.fromAHSL(1, colors[1][0], colors[1][1], colors[1][2]).toColor(), 9 | ]; 10 | } 11 | 12 | List> hslTriad(double h, double s, double l) { 13 | return [ 14 | [h, s, l], 15 | [(h + 120) % 360, s, l], 16 | [(h + 240) % 360, s, l], 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/not_implemented.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | void notImplemented(BuildContext context) { 5 | logError(UnimplementedError('not implemented'), StackTrace.current); 6 | showDialog( 7 | context: context, 8 | builder: (context) => AlertDialog( 9 | content: const Text('Not implemented'), 10 | actions: [ 11 | TextButton( 12 | onPressed: () => Navigator.of(context).pop(), 13 | child: const Text('OK'), 14 | ) 15 | ], 16 | ), 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/alan/alan_account_derivation_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/wallet/network_info.dart'; 2 | import 'package:transaction_signing_gateway/model/account_derivation_info.dart'; 3 | 4 | class AlanAccountDerivationInfo implements AccountDerivationInfo { 5 | AlanAccountDerivationInfo({ 6 | required this.chainId, 7 | required this.accountAlias, 8 | required this.networkInfo, 9 | required this.mnemonic, 10 | }); 11 | 12 | final String mnemonic; 13 | final String chainId; 14 | final String accountAlias; 15 | 16 | final NetworkInfo networkInfo; 17 | } 18 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/model/local_auth_failure.dart: -------------------------------------------------------------------------------- 1 | enum LocalAuthFailureType { 2 | noBiometrics, 3 | unknown, 4 | } 5 | 6 | class LocalAuthFailure { 7 | const LocalAuthFailure.noBiometricsAvailable([this.cause, this.stack]) : type = LocalAuthFailureType.noBiometrics; 8 | 9 | const LocalAuthFailure.unknown([this.cause, this.stack]) : type = LocalAuthFailureType.unknown; 10 | 11 | final LocalAuthFailureType type; 12 | final dynamic cause; 13 | final dynamic stack; 14 | 15 | @override 16 | String toString() { 17 | return 'LocalAuthFailure{type: $type, cause: $cause,\nstack: $stack}'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /starport_template/lib/model/tx_response_json.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/model/tx_json.dart'; 2 | 3 | class TxResponseJson { 4 | TxResponseJson({ 5 | required this.txhash, 6 | required this.tx, 7 | required this.timestamp, 8 | }); 9 | 10 | factory TxResponseJson.fromJson(Map json) => TxResponseJson( 11 | txhash: json['txhash'] as String? ?? '', 12 | tx: TxJson.fromJson(json['tx'] as Map), 13 | timestamp: DateTime.parse(json['timestamp'] as String), 14 | ); 15 | 16 | String txhash; 17 | TxJson tx; 18 | DateTime timestamp; 19 | } 20 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/lib/account/account_derivation_failure.dart: -------------------------------------------------------------------------------- 1 | enum AccountDerivationFailureType { 2 | Unknown, 3 | InvalidMnemonic, 4 | } 5 | 6 | class AccountDerivationFailure { 7 | const AccountDerivationFailure.unknown({this.cause}) : type = AccountDerivationFailureType.Unknown; 8 | 9 | const AccountDerivationFailure.invalidMnemonic({this.cause}) : type = AccountDerivationFailureType.InvalidMnemonic; 10 | 11 | final AccountDerivationFailureType type; 12 | final Object? cause; 13 | 14 | @override 15 | String toString() { 16 | return 'AccountDerivationFailure{type: $type, cause: $cause}'; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /starport_template/lib/entities/transaction_history_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/entities/amount.dart'; 2 | import 'package:starport_template/entities/denom.dart'; 3 | 4 | enum TransactionType { 5 | Receive, 6 | Send, 7 | } 8 | 9 | class TransactionHistoryItem { 10 | TransactionHistoryItem({ 11 | required this.denom, 12 | required this.amount, 13 | required this.date, 14 | required this.type, 15 | }); 16 | 17 | final TransactionType type; 18 | final DateTime date; 19 | final Amount amount; 20 | 21 | final Denom denom; 22 | 23 | String get transactionType => type.toString().split('.')[1]; 24 | } 25 | -------------------------------------------------------------------------------- /starport_template/lib/entities/amount.dart: -------------------------------------------------------------------------------- 1 | import 'package:decimal/decimal.dart'; 2 | 3 | class Amount { 4 | const Amount(this.value); 5 | 6 | Amount.fromString(String string) : value = Decimal.parse(string); 7 | Amount.fromInt(int int) : value = Decimal.fromInt(int); 8 | 9 | final Decimal value; 10 | 11 | @override 12 | String toString() => value.toStringAsPrecision(10); 13 | 14 | String get displayText => value.toStringAsPrecision(10); 15 | } 16 | 17 | extension StringAmount on String { 18 | Amount get amount => Amount.fromString(this); 19 | } 20 | 21 | extension IntAmount on int { 22 | Amount get amount => Amount.fromInt(this); 23 | } 24 | -------------------------------------------------------------------------------- /packages/cosmos_utils/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cosmos_utils 2 | description: Common utils package 3 | version: 0.0.1 4 | homepage: starport.com 5 | 6 | environment: 7 | sdk: ">=2.14.0 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | dartz: ^0.10.1 14 | intl: ^0.17.0 15 | bip39: ^1.0.6 16 | bech32: ^0.2.1 17 | hex: ^0.2.0 18 | equatable: ^2.0.3 19 | package_info: 2.0.2 20 | 21 | dev_dependencies: 22 | flutter_test: 23 | sdk: flutter 24 | cosmos_lint: 25 | git: 26 | url: https://github.com/tendermint/flutter.git 27 | path: packages/cosmos_lint 28 | ref: main 29 | 30 | flutter: 31 | -------------------------------------------------------------------------------- /starport_template/lib/utils/node_info_loader.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:starport_template/app_config.dart'; 5 | 6 | class NodeInfoLoader { 7 | NodeInfoLoader(this.appConfig); 8 | 9 | AppConfig appConfig; 10 | 11 | Future getChainId() async { 12 | final uri = '${appConfig.baseApiUrl}/node_info'; 13 | final response = await http.get(Uri.parse(uri)); 14 | final map = jsonDecode(response.body) as Map; 15 | if (map['node_info'] == null) { 16 | return ''; 17 | } 18 | 19 | return (map['node_info'] as Map)['network'] as String; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /starport_template/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.5.10' 3 | repositories { 4 | google() 5 | jcenter() 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 | jcenter() 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 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/utils/date_formatter.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | String formatDate(DateTime date, DateFormatEnum dateFormat) => DateFormat(getDateFormat[dateFormat]).format(date); 4 | 5 | String extractMonth(String groupedMonthYear) => groupedMonthYear.split('-')[0]; 6 | 7 | abstract class DateFormats { 8 | static const String uiShortDate = 'MMM d'; 9 | static const String groupByMonthYear = 'MMMM-yyyy'; 10 | } 11 | 12 | enum DateFormatEnum { 13 | shortUIDateDay, 14 | groupByMonthYear, 15 | } 16 | 17 | Map getDateFormat = { 18 | DateFormatEnum.shortUIDateDay: DateFormats.uiShortDate, 19 | DateFormatEnum.groupByMonthYear: DateFormats.groupByMonthYear, 20 | }; 21 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/screenshot_tests/flutter_test_config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:alchemist/alchemist.dart'; 4 | import 'package:golden_toolkit/golden_toolkit.dart'; 5 | 6 | Future testExecutable(FutureOr Function() testMain) async { 7 | await loadAppFonts(); 8 | // ignore: do_not_use_environment 9 | const isCi = bool.fromEnvironment('IS_CI'); 10 | return AlchemistConfig.runWithConfig( 11 | config: const AlchemistConfig( 12 | platformGoldensConfig: PlatformGoldensConfig( 13 | // ignore: avoid_redundant_argument_values 14 | enabled: !isCi, 15 | ), 16 | ), 17 | run: () async { 18 | return testMain(); 19 | }, 20 | ); 21 | } 22 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/mobile/no_op_transaction_summary_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:transaction_signing_gateway/model/transaction_signing_failure.dart'; 3 | import 'package:transaction_signing_gateway/model/unsigned_transaction.dart'; 4 | import 'package:transaction_signing_gateway/transaction_summary_ui.dart'; 5 | 6 | /// Transaction summary UI that displays nothing and immediately proceeds with "success" user confirmation 7 | class NoOpTransactionSummaryUI implements TransactionSummaryUI { 8 | @override 9 | Future> showTransactionSummaryUI({ 10 | required UnsignedTransaction transaction, 11 | }) async { 12 | return right(unit); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/transaction_log.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class TransactionLog extends Equatable { 4 | const TransactionLog({ 5 | required this.msgIndex, 6 | required this.log, 7 | this.events = const [], 8 | }); 9 | 10 | final int msgIndex; 11 | final String log; 12 | final List events; 13 | 14 | @override 15 | List get props => [ 16 | msgIndex, 17 | log, 18 | events, 19 | ]; 20 | 21 | TransactionLog copyWith({ 22 | int? msgIndex, 23 | String? log, 24 | List? events, 25 | }) { 26 | return TransactionLog( 27 | msgIndex: msgIndex ?? this.msgIndex, 28 | log: log ?? this.log, 29 | events: events ?? this.events, 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /starport_template/lib/model/tx_body_message_json.dart: -------------------------------------------------------------------------------- 1 | import 'package:starport_template/model/amount_json.dart'; 2 | 3 | class TxBodyMessageJson { 4 | TxBodyMessageJson({ 5 | required this.type, 6 | required this.fromAddress, 7 | required this.toAddress, 8 | required this.amount, 9 | }); 10 | 11 | factory TxBodyMessageJson.fromJson(Map json) => TxBodyMessageJson( 12 | type: json['@type'] as String? ?? '', 13 | fromAddress: json['from_address'] as String? ?? '', 14 | toAddress: json['to_address'] as String? ?? '', 15 | amount: (json['amount'] as List).map((x) => AmountJson.fromJson(x as Map)).toList(), 16 | ); 17 | 18 | String type; 19 | String fromAddress; 20 | String toAddress; 21 | List amount; 22 | } 23 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/transaction_broadcasting_failure.dart: -------------------------------------------------------------------------------- 1 | enum TransactionBroadcastingFailType { 2 | noTransactionBroadcasterFound, 3 | accountCredentialsStorageFailure, 4 | unknown, 5 | } 6 | 7 | abstract class TransactionBroadcastingFailure { 8 | TransactionBroadcastingFailType get type; 9 | } 10 | 11 | class TransactionBroadcasterNotFoundFailure extends TransactionBroadcastingFailure { 12 | @override 13 | TransactionBroadcastingFailType get type => TransactionBroadcastingFailType.noTransactionBroadcasterFound; 14 | } 15 | 16 | class StorageProblemBroadcastingFailure extends TransactionBroadcastingFailure { 17 | @override 18 | // TODO: implement type 19 | TransactionBroadcastingFailType get type => TransactionBroadcastingFailType.accountCredentialsStorageFailure; 20 | } 21 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/lib/account/mnemonic.dart: -------------------------------------------------------------------------------- 1 | import 'package:bip39/bip39.dart' as bip39; 2 | import 'package:cosmos_utils/cosmos_utils.dart'; 3 | 4 | enum MnemonicLength { 5 | words12, 6 | words24, 7 | } 8 | 9 | class Mnemonic { 10 | const Mnemonic(this.value); 11 | 12 | Mnemonic.fromWords(List words) : this(words.join(' ')); 13 | 14 | static Future generate(MnemonicLength length) async { 15 | switch (length) { 16 | case MnemonicLength.words12: 17 | return Mnemonic(await generateMnemonic(strength: 128)); 18 | case MnemonicLength.words24: 19 | return Mnemonic(await generateMnemonic()); 20 | } 21 | } 22 | 23 | final String value; 24 | 25 | List get words => value.splitToWords(); 26 | 27 | bool isValid() => bip39.validateMnemonic(value); 28 | } 29 | -------------------------------------------------------------------------------- /starport_template/lib/entities/balance.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:starport_template/entities/amount.dart'; 3 | import 'package:starport_template/entities/denom.dart'; 4 | 5 | class Balance extends Equatable { 6 | const Balance({ 7 | required this.denom, 8 | required this.amount, 9 | }); 10 | 11 | final Denom denom; 12 | final Amount amount; 13 | 14 | @override 15 | String toString() => '$amount $denom'; 16 | 17 | String get amountWithDenomText => denom.amountWithDenomText(amount); 18 | 19 | @override 20 | List get props => [ 21 | denom, 22 | amount, 23 | ]; 24 | 25 | Balance copyWith({ 26 | Denom? denom, 27 | Amount? amount, 28 | }) { 29 | return Balance( 30 | denom: denom ?? this.denom, 31 | amount: amount ?? this.amount, 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/model/read_password_failure.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/credentials_storage_failure.dart'; 2 | 3 | enum ReadPasswordFailureType { 4 | Unknown, 5 | AuthenticationFailed, 6 | SecureStorageFail, 7 | } 8 | 9 | class ReadPasswordFailure { 10 | const ReadPasswordFailure.unknown([ 11 | this.cause, 12 | this.stack, 13 | ]) : type = ReadPasswordFailureType.Unknown; 14 | 15 | const ReadPasswordFailure.authenticationFailed([ 16 | this.cause, 17 | this.stack, 18 | ]) : type = ReadPasswordFailureType.AuthenticationFailed; 19 | 20 | const ReadPasswordFailure.secureStorageFailure( 21 | CredentialsStorageFailure fail, [ 22 | this.stack, 23 | ]) : cause = fail, 24 | type = ReadPasswordFailureType.SecureStorageFail; 25 | 26 | final ReadPasswordFailureType type; 27 | final Object? cause; 28 | final dynamic stack; 29 | } 30 | -------------------------------------------------------------------------------- /starport_template/lib/entities/account_additional_data.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:transaction_signing_gateway/transaction_signing_gateway.dart'; 4 | 5 | class AccountAdditionalData { 6 | AccountAdditionalData({ 7 | required this.isBackedUp, 8 | }); 9 | 10 | factory AccountAdditionalData.fromJson(Map map) { 11 | return AccountAdditionalData( 12 | isBackedUp: map['isBackedUp'] as bool? ?? false, 13 | ); 14 | } 15 | 16 | final bool isBackedUp; 17 | 18 | Map toJson() { 19 | return { 20 | 'isBackedUp': isBackedUp, 21 | }; 22 | } 23 | 24 | String toJsonString() => jsonEncode(toJson()); 25 | } 26 | 27 | extension AdditionalDataParsing on AccountPublicInfo { 28 | AccountAdditionalData get data => 29 | AccountAdditionalData.fromJson(jsonDecode(additionalData ?? '{}') as Map); 30 | } 31 | -------------------------------------------------------------------------------- /starport_template/ios/fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ---- 3 | 4 | # Installation 5 | 6 | Make sure you have the latest version of the Xcode command line tools installed: 7 | 8 | ```sh 9 | xcode-select --install 10 | ``` 11 | 12 | For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) 13 | 14 | # Available Actions 15 | 16 | ## iOS 17 | 18 | ### ios deploy_firebase 19 | 20 | ```sh 21 | [bundle exec] fastlane ios deploy_firebase 22 | ``` 23 | 24 | deploys to firebase app distribution 25 | 26 | ---- 27 | 28 | This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. 29 | 30 | More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). 31 | 32 | The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 33 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_divider.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CosmosDivider extends StatelessWidget { 6 | const CosmosDivider({Key? key, this.edgeInsets}) : super(key: key); 7 | 8 | final EdgeInsets? edgeInsets; 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | final theme = CosmosTheme.of(context); 13 | return Padding( 14 | padding: edgeInsets ?? EdgeInsets.symmetric(horizontal: theme.spacingL), 15 | child: Divider(color: theme.colors.divider), 16 | ); 17 | } 18 | 19 | @override 20 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 21 | super.debugFillProperties(properties); 22 | properties.add(DiagnosticsProperty('edgeInsets', edgeInsets)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /starport_template/android/fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ---- 3 | 4 | # Installation 5 | 6 | Make sure you have the latest version of the Xcode command line tools installed: 7 | 8 | ```sh 9 | xcode-select --install 10 | ``` 11 | 12 | For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) 13 | 14 | # Available Actions 15 | 16 | ## Android 17 | 18 | ### android deploy_firebase 19 | 20 | ```sh 21 | [bundle exec] fastlane android deploy_firebase 22 | ``` 23 | 24 | deploys to firebase app distribution 25 | 26 | ---- 27 | 28 | This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. 29 | 30 | More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). 31 | 32 | The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 33 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/lib/utils/utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:bech32/bech32.dart'; 2 | 3 | List convertBits( 4 | List data, { 5 | required int from, 6 | required int to, 7 | bool pad = true, 8 | }) { 9 | var acc = 0; 10 | var bits = 0; 11 | final result = []; 12 | final maxV = (1 << to) - 1; 13 | 14 | for (final v in data) { 15 | if (v < 0 || (v >> from) != 0) { 16 | throw Exception(); 17 | } 18 | acc = (acc << from) | v; 19 | bits += from; 20 | while (bits >= to) { 21 | bits -= to; 22 | result.add((acc >> bits) & maxV); 23 | } 24 | } 25 | 26 | if (pad) { 27 | if (bits > 0) { 28 | result.add((acc << (to - bits)) & maxV); 29 | } 30 | } else if (bits >= from) { 31 | throw InvalidPadding('illegal zero padding'); 32 | } else if (((acc << (to - bits)) & maxV) != 0) { 33 | throw InvalidPadding('non zero'); 34 | } 35 | 36 | return result; 37 | } 38 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/transaction_summary_ui.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:transaction_signing_gateway/model/transaction_signing_failure.dart'; 3 | import 'package:transaction_signing_gateway/model/unsigned_transaction.dart'; 4 | 5 | abstract class TransactionSummaryUI { 6 | /// Shows a summary of the transaction for the user to approve. 7 | /// 8 | /// Implementations of this method should display a summary of the transaction that is about to be signed. 9 | /// This method allows the user to review all of the relevant details and present them with options to approve 10 | /// or decline the transaction. If the transaction is declined, the returned [Future] emits 11 | /// `left(UserDeclinedTransactionSignerFailure)`, otherwise a `right(unit)` denotes a success. 12 | Future> showTransactionSummaryUI({ 13 | required UnsignedTransaction transaction, 14 | }); 15 | } 16 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_token_avatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CosmosTokenAvatar extends StatelessWidget { 6 | const CosmosTokenAvatar({ 7 | required this.text, 8 | Key? key, 9 | }) : super(key: key); 10 | 11 | final String text; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | final theme = CosmosTheme.of(context); 16 | return SizedBox( 17 | height: 32, 18 | child: CircleAvatar( 19 | backgroundColor: theme.colors.avatarBg, 20 | foregroundColor: theme.colors.text, 21 | child: Text(text[0].toUpperCase()), 22 | ), 23 | ); 24 | } 25 | 26 | @override 27 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 28 | super.debugFillProperties(properties); 29 | properties.add(StringProperty('text', text)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/empty_list_message.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class EmptyListMessage extends StatelessWidget { 7 | const EmptyListMessage({ 8 | required this.message, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final String message; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: Text( 18 | message, 19 | style: CosmosTextTheme.title1Bold.copyWith( 20 | color: CosmosTheme.of(context).colors.inactive, 21 | ), 22 | ), 23 | ); 24 | } 25 | 26 | @override 27 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 28 | super.debugFillProperties(properties); 29 | properties.add(StringProperty('message', message)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/gradient_avatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class GradientAvatar extends StatelessWidget { 6 | const GradientAvatar({ 7 | required this.stringKey, 8 | Key? key, 9 | }) : super(key: key); 10 | 11 | final String stringKey; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | final colors = generateColorsFromAddress(stringKey); 16 | return CircleAvatar( 17 | child: Container( 18 | decoration: BoxDecoration( 19 | shape: BoxShape.circle, 20 | gradient: LinearGradient(colors: [colors[0], colors[1]]), 21 | ), 22 | ), 23 | ); 24 | } 25 | 26 | @override 27 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 28 | super.debugFillProperties(properties); 29 | properties.add(StringProperty('stringKey', stringKey)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/data_store.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/credentials_storage_failure.dart'; 2 | import 'package:dartz/dartz.dart'; 3 | 4 | abstract class PlainDataStore { 5 | Future> savePlainText({ 6 | required String key, 7 | required String? value, 8 | }); 9 | 10 | Future> readPlainText({ 11 | required String key, 12 | }); 13 | 14 | Future>> readAllPlainText(); 15 | 16 | Future> clearAllData(); 17 | } 18 | 19 | abstract class SecureDataStore { 20 | Future> saveSecureText({ 21 | required String key, 22 | required String? value, 23 | }); 24 | 25 | Future> readSecureText({ 26 | required String key, 27 | }); 28 | 29 | Future> clearAllData(); 30 | } 31 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/README.md: -------------------------------------------------------------------------------- 1 | # transaction_signing_gateway 2 | 3 | The transaction signing gateway library encapsulates the logic for securely storing wallet credentials and allows for specifying a sandbox environment for transaction signing. This library was created with extendability in mind. If you want to support your own proprietary chain implementations, you can pass in your own implementation of signing transactions as well as serializing and deserializing wallet credentials. 4 | 5 | ## Getting Started 6 | 7 | An access point is the `TransactionSigningGateway` class that you must first initialize with the implementations of various dependent classes. For example: 8 | ```dart 9 | final signingGateway = TransactionSigningGateway( 10 | transactionSummaryUI: MobileTransactionSummaryUI(), 11 | infoStorage: MobileKeyInfoStorage(serializers: [ 12 | SaccoCredentialsSerializer(), 13 | ]), 14 | signers: [ 15 | SaccoTransactionSigner(), 16 | ], 17 | ); 18 | ``` -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/screenshot_tests/cosmos_elevated_button_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:alchemist/alchemist.dart'; 2 | import 'package:cosmos_ui_components/components/cosmos_elevated_button.dart'; 3 | 4 | import '../test_utils/golden_test_utils.dart'; 5 | import '../test_utils/screenshot_test_scenario.dart'; 6 | 7 | void main() { 8 | screenshotTest( 9 | 'cosmos_elevated_button', 10 | pageBuilder: (themeData) => GoldenTestGroup( 11 | children: [ 12 | ScreenshotTestScenario( 13 | name: 'normal', 14 | themeData: themeData, 15 | builder: (context) => CosmosElevatedButton( 16 | text: 'Elevated Button', 17 | onTap: () {}, 18 | ), 19 | ), 20 | ScreenshotTestScenario( 21 | name: 'disabled', 22 | themeData: themeData, 23 | builder: (context) => const CosmosElevatedButton( 24 | text: 'Elevated Button', 25 | ), 26 | ) 27 | ], 28 | ), 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/account_derivator.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:transaction_signing_gateway/model/account_derivation_failure.dart'; 3 | import 'package:transaction_signing_gateway/model/account_derivation_info.dart'; 4 | import 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 5 | 6 | abstract class AccountDerivator { 7 | Future> derive({ 8 | required AccountDerivationInfo accountDerivationInfo, 9 | }); 10 | 11 | bool canDerive(AccountDerivationInfo accountDerivationInfo); 12 | } 13 | 14 | class NotFoundDerivator implements AccountDerivator { 15 | @override 16 | bool canDerive(AccountDerivationInfo accountDerivationInfo) => true; 17 | 18 | @override 19 | Future> derive({ 20 | required AccountDerivationInfo accountDerivationInfo, 21 | }) async => 22 | left(const DerivatorNotFoundFailure()); 23 | } 24 | -------------------------------------------------------------------------------- /packages/cosmos_auth/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cosmos_auth 2 | description: biometrics helper package 3 | version: 0.0.1 4 | publish_to: 'none' 5 | homepage: starport.com 6 | 7 | environment: 8 | sdk: ">=2.14.0 <3.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | local_auth: ^1.1.10 15 | cosmos_utils: 16 | git: 17 | url: https://github.com/tendermint/flutter.git 18 | path: packages/cosmos_utils 19 | ref: main 20 | 21 | ## convenient overrides for development to reference packages on local disk, just uncomment following lines and make sure 22 | ## it points to the location of the checked out tendermint/flutter repository 23 | #dependency_overrides: 24 | # cosmos_utils: 25 | # path: ../cosmos_utils 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | cosmos_lint: 31 | git: 32 | url: https://github.com/tendermint/flutter.git 33 | path: packages/cosmos_lint 34 | ref: main 35 | mocktail: 0.2.0 36 | 37 | flutter: 38 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/logger.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | 3 | /// allows for specifying global error logger for the app. you can replace it with something 'harmless' for testing 4 | // ignore: prefer_function_declarations_over_variables 5 | void Function(dynamic error, dynamic stack, String? reason) errorLogger = (error, stack, reason) { 6 | // TODO add firebase crashlytics or equivalent logging here 7 | debugLog( 8 | 'ERROR ${reason == null ? '' : ': $reason'}\n' 9 | '================\n' 10 | 'error: $error\n' 11 | 'stack: $stack\n' 12 | '================\n', 13 | ); 14 | }; 15 | 16 | void logError(dynamic error, [dynamic stack, String? reason]) { 17 | errorLogger(error, stack, reason); 18 | } 19 | 20 | void logErrorIf(bool Function() predicate, dynamic error, [dynamic stack, String? reason]) { 21 | if (predicate()) { 22 | logError(error, stack); 23 | } 24 | } 25 | 26 | void debugLog(String message, [dynamic caller]) { 27 | debugPrint(caller == null ? message : '${caller.runtimeType}: $message'); 28 | } 29 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/alan/alan_transaction.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/alan.dart'; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:protobuf/protobuf.dart'; 4 | import 'package:transaction_signing_gateway/model/signed_transaction.dart'; 5 | import 'package:transaction_signing_gateway/model/unsigned_transaction.dart'; 6 | 7 | class UnsignedAlanTransaction extends Equatable implements UnsignedTransaction { 8 | const UnsignedAlanTransaction({ 9 | required this.messages, 10 | this.memo = '', 11 | this.fee, 12 | }); 13 | 14 | final List messages; 15 | final String memo; 16 | 17 | final Fee? fee; 18 | 19 | @override 20 | List get props => [ 21 | messages, 22 | memo, 23 | fee, 24 | ]; 25 | } 26 | 27 | class SignedAlanTransaction extends Equatable implements SignedTransaction { 28 | const SignedAlanTransaction({required this.signedTransaction}); 29 | 30 | final Tx signedTransaction; 31 | 32 | @override 33 | List get props => [signedTransaction]; 34 | } 35 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/test/mnemonic_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_node_client/account/mnemonic.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test( 6 | 'value should be words joined with space', 7 | () => expect(Mnemonic.fromWords(_words).value, _words.join(' ')), 8 | ); 9 | 10 | test( 11 | 'words should be value split with space', 12 | () async => expect( 13 | Mnemonic(_words.join(' ')).words, 14 | _words, 15 | ), 16 | ); 17 | 18 | test( 19 | 'should generate mnemonic with 12 words', 20 | () async => expect((await Mnemonic.generate(MnemonicLength.words12)).words.length, 12), 21 | ); 22 | 23 | test( 24 | 'should generate mnemonic with 24 words', 25 | () async => expect((await Mnemonic.generate(MnemonicLength.words24)).words.length, 24), 26 | ); 27 | } 28 | 29 | final _words = [ 30 | 'bike', 31 | 'child', 32 | 'finish', 33 | 'slide', 34 | 'general', 35 | 'track', 36 | 'appear', 37 | 'youth', 38 | 'lucky', 39 | 'damage', 40 | 'lesson', 41 | 'divorce' 42 | ]; 43 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/content_loading_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class ContentLoadingIndicator extends StatelessWidget { 6 | const ContentLoadingIndicator({ 7 | Key? key, 8 | this.message = '', 9 | }) : super(key: key); 10 | 11 | final String message; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: Column( 17 | mainAxisAlignment: MainAxisAlignment.center, 18 | children: [ 19 | CircularProgressIndicator(color: CosmosTheme.of(context).colors.text), 20 | SizedBox(height: CosmosTheme.of(context).spacingM), 21 | if (message.isNotEmpty) Text(message), 22 | ], 23 | ), 24 | ); 25 | } 26 | 27 | @override 28 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 29 | super.debugFillProperties(properties); 30 | properties.add(StringProperty('message', message)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/template/transaction_history_group_title.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class TransactionHistoryGroupTitle extends StatelessWidget { 7 | const TransactionHistoryGroupTitle({ 8 | required this.title, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final String title; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | final theme = CosmosTheme.of(context); 17 | return Padding( 18 | padding: EdgeInsets.all(theme.spacingL), 19 | child: Text( 20 | title, 21 | style: CosmosTextTheme.title0Bold.copyWith( 22 | color: theme.colors.text, 23 | ), 24 | ), 25 | ); 26 | } 27 | 28 | @override 29 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 30 | super.debugFillProperties(properties); 31 | properties.add(StringProperty('title', title)); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /starport_template/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/future_either.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | 3 | extension FutureEither on Future> { 4 | Future> flatMap(Function1>> f) { 5 | return then( 6 | (either1) => either1.fold( 7 | (l) => Future.value(left(l)), 8 | f, 9 | ), 10 | ); 11 | } 12 | 13 | Future>> zipWith(Future> withThis) => flatMap( 14 | (r) async => withThis.flatMap( 15 | (r2) async => right(Tuple2(r, r2)), 16 | ), 17 | ); 18 | 19 | Future> leftMap(Function1> f) { 20 | return then( 21 | (either1) => either1.fold( 22 | (l) => Future.value(f(l)), 23 | (r) => Future.value(right(r)), 24 | ), 25 | ); 26 | } 27 | 28 | Future> map(Function1> f) { 29 | return then( 30 | (either1) => either1.fold( 31 | (l) => Future.value(left(l)), 32 | (r) => Future.value(f(r)), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/lib/utils/extensions.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | /// Extension methods on the [Uint8List] class. 4 | extension Uin8ListExt on Uint8List { 5 | /// Encodes this [Uint8List] to a [BigInt] using the big-endian conversion. 6 | BigInt toBigInt() { 7 | final bytes = this; 8 | var result = BigInt.from(0); 9 | for (var i = 0; i < bytes.length; i++) { 10 | result += BigInt.from(bytes[bytes.length - i - 1]) << (8 * i); 11 | } 12 | return result; 13 | } 14 | } 15 | 16 | extension BigIntExtension on BigInt { 17 | /// Converts this [BigInt] into a [Uint8List] encoding it with 18 | /// the big-endian encoding. 19 | Uint8List toUin8List() { 20 | // Not handling negative numbers. Decide how you want to do that. 21 | final _byteMask = BigInt.from(0xff); 22 | var number = this; 23 | final size = (number.bitLength + 7) >> 3; 24 | final result = Uint8List(size); 25 | 26 | for (var i = 0; i < size; i++) { 27 | result[size - i - 1] = (number & _byteMask).toInt(); 28 | number = number >> 8; 29 | } 30 | return result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cosmos_node_client 2 | description: cosmos node client package 3 | version: 0.0.1 4 | publish_to: 'none' 5 | homepage: starport.com 6 | 7 | environment: 8 | sdk: ">=2.14.0 <3.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | bech32: 0.2.1 15 | bip39: 1.0.6 16 | equatable: 2.0.3 17 | dartz: 0.10.1 18 | pointycastle: 3.6.0 19 | hex: 0.2.0 20 | cosmos_utils: 21 | git: 22 | url: https://github.com/tendermint/flutter.git 23 | path: packages/cosmos_utils 24 | ref: main 25 | 26 | ## convenient overrides for development to reference packages on local disk, just uncomment following lines and make sure 27 | ## it points to the location of the checked out tendermint/flutter repository 28 | #dependency_overrides: 29 | # cosmos_utils: 30 | # path: ../cosmos_utils 31 | 32 | dev_dependencies: 33 | flutter_test: 34 | sdk: flutter 35 | cosmos_lint: 36 | git: 37 | url: https://github.com/tendermint/flutter.git 38 | path: packages/cosmos_lint 39 | ref: main 40 | 41 | mocktail: 0.3.0 42 | 43 | flutter: 44 | -------------------------------------------------------------------------------- /packages/cosmos_utils/test/mnemonic_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | 4 | void main() { 5 | test('validate mnemonic', () async { 6 | expect(validateMnemonic('words are words'), MnemonicValidationError.WrongNumberOfWords); 7 | expect(validateMnemonic('invalid character!'), MnemonicValidationError.InvalidCharacter); 8 | expect(validateMnemonic(''), MnemonicValidationError.MnemonicEmpty); 9 | expect( 10 | validateMnemonic( 11 | 'pink later snow hire pill message improve jeans supply reflect wave right silent inflict ' 12 | 'fiction riot hurdle belt awkward zero direct will giant dose', 13 | ), 14 | MnemonicValidationError.Unknown, 15 | ); 16 | expect( 17 | validateMnemonic( 18 | 'later pink snow hire pill message improve jeans supply reflect ' 19 | 'wave right silent inflict fiction riot hurdle belt awkward zero direct will giant dose', 20 | ), 21 | null, 22 | ); 23 | expect( 24 | validateMnemonic('delay cruise little equip orange dolphin jealous fluid little nurse cube version'), 25 | null, 26 | ); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/aes_cipher_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:transaction_signing_gateway/encrypt/aes_cipher.dart'; 3 | 4 | void main() { 5 | group('AesCipher', () { 6 | const password = 'coolPassword123!'; 7 | const testData = 'this is test data'; 8 | final cipher = AESCipher(); 9 | 10 | test('encrypting and decrypting works', () async { 11 | final encrypted = cipher.encrypt(password: password, data: testData); 12 | final decrypted = cipher.decrypt(password: password, encryptedData: encrypted); 13 | expect(testData, decrypted); 14 | }); 15 | test('encrypting same data yields different result each time', () async { 16 | final cipher = AESCipher(); 17 | 18 | final en1 = cipher.encrypt(password: password, data: testData); 19 | final en2 = cipher.encrypt(password: password, data: testData); 20 | expect(en1, isNot(equals(en2))); 21 | final dec1 = cipher.decrypt(password: password, encryptedData: en1); 22 | final dec2 = cipher.decrypt(password: password, encryptedData: en2); 23 | expect(dec1, equals(dec2)); 24 | }); 25 | }); 26 | 27 | setUp(() {}); 28 | } 29 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_app_bar_action.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/components/cosmos_text_button.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class CosmosAppBarAction extends StatelessWidget { 7 | const CosmosAppBarAction({ 8 | required this.onTap, 9 | required this.text, 10 | Key? key, 11 | }) : super(key: key); 12 | 13 | final VoidCallback onTap; 14 | final String text; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | final theme = CosmosTheme.of(context); 19 | return Padding( 20 | padding: EdgeInsets.symmetric( 21 | horizontal: theme.spacingS, 22 | ), 23 | child: CosmosTextButton( 24 | onTap: onTap, 25 | text: text, 26 | color: theme.colors.text, 27 | ), 28 | ); 29 | } 30 | 31 | @override 32 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 33 | super.debugFillProperties(properties); 34 | properties 35 | ..add(StringProperty('text', text)) 36 | ..add(ObjectFlagProperty.has('onTap', onTap)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/transaction_broadcaster.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 3 | import 'package:transaction_signing_gateway/model/signed_transaction.dart'; 4 | import 'package:transaction_signing_gateway/model/transaction_broadcasting_failure.dart'; 5 | import 'package:transaction_signing_gateway/model/transaction_response.dart'; 6 | 7 | abstract class TransactionBroadcaster { 8 | Future> broadcast({ 9 | required SignedTransaction transaction, 10 | required PrivateAccountCredentials privateAccountCredentials, 11 | }); 12 | 13 | bool canBroadcast(SignedTransaction signedTransaction); 14 | } 15 | 16 | class NotFoundBroadcaster implements TransactionBroadcaster { 17 | @override 18 | Future> broadcast({ 19 | required SignedTransaction transaction, 20 | required PrivateAccountCredentials privateAccountCredentials, 21 | }) async => 22 | left(TransactionBroadcasterNotFoundFailure()); 23 | 24 | @override 25 | bool canBroadcast(SignedTransaction signedTransaction) => true; 26 | } 27 | -------------------------------------------------------------------------------- /starport_template/lib/utils/cosmos_balances.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | import 'package:starport_template/app_config.dart'; 5 | import 'package:starport_template/entities/amount.dart'; 6 | import 'package:starport_template/entities/balance.dart'; 7 | import 'package:starport_template/entities/denom.dart'; 8 | import 'package:starport_template/model/balance_json.dart'; 9 | 10 | class CosmosBalances { 11 | CosmosBalances(this.appConfig); 12 | 13 | AppConfig appConfig; 14 | 15 | Future> getBalances(String accountAddress) async { 16 | final uri = '${appConfig.baseApiUrl}/cosmos/bank/v1beta1/balances/$accountAddress'; 17 | final response = await http.get(Uri.parse(uri)); 18 | final map = jsonDecode(response.body) as Map; 19 | if (map['balances'] == null) { 20 | return []; 21 | } 22 | final list = map['balances'] as List; 23 | 24 | return list 25 | .map((e) => BalanceJson.fromJson(e as Map)) 26 | .map( 27 | (e) => Balance( 28 | denom: Denom(e.denom), 29 | amount: Amount.fromString(e.amount), 30 | ), 31 | ) 32 | .toList(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/address_parser.dart: -------------------------------------------------------------------------------- 1 | import 'package:bech32/bech32.dart'; 2 | import 'package:hex/hex.dart'; 3 | 4 | @Deprecated("Use cosmos-node-client's `Account` class instead") 5 | String bech32ToHex(String address) { 6 | const bech32codec = Bech32Codec(); 7 | final bech32address = bech32codec.decode(address); 8 | 9 | return HEX.encode(_convertBits(bech32address.data, 5, 8, false)); 10 | } 11 | 12 | @Deprecated("Use cosmos-node-client's `Account` class instead") 13 | List _convertBits(List data, int from, int to, bool pad) { 14 | var acc = 0; 15 | var bits = 0; 16 | final result = []; 17 | final maxV = (1 << to) - 1; 18 | 19 | for (final v in data) { 20 | if (v < 0 || (v >> from) != 0) { 21 | throw Exception(); 22 | } 23 | acc = (acc << from) | v; 24 | bits += from; 25 | while (bits >= to) { 26 | bits -= to; 27 | result.add((acc >> bits) & maxV); 28 | } 29 | } 30 | 31 | if (pad) { 32 | if (bits > 0) { 33 | result.add((acc << (to - bits)) & maxV); 34 | } 35 | } else if (bits >= from) { 36 | throw InvalidPadding('illegal zero padding'); 37 | } else if (((acc << (to - bits)) & maxV) != 0) { 38 | throw InvalidPadding('non zero'); 39 | } 40 | 41 | return result; 42 | } 43 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_error_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CosmosErrorView extends StatelessWidget { 6 | const CosmosErrorView({ 7 | required this.title, 8 | required this.message, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final String title; 13 | final String message; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisSize: MainAxisSize.min, 20 | children: [ 21 | Icon( 22 | Icons.error, 23 | color: Theme.of(context).colorScheme.error, 24 | ), 25 | SizedBox(height: CosmosTheme.of(context).spacingM), 26 | Text(title), 27 | SizedBox(height: CosmosTheme.of(context).spacingM), 28 | Text(message), 29 | ], 30 | ), 31 | ); 32 | } 33 | 34 | @override 35 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 36 | super.debugFillProperties(properties); 37 | properties 38 | ..add(StringProperty('title', title)) 39 | ..add(StringProperty('message', message)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_bottom_sheet_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class CosmosBottomSheetContainer extends StatelessWidget { 5 | const CosmosBottomSheetContainer({ 6 | required this.child, 7 | Key? key, 8 | }) : super(key: key); 9 | 10 | final Widget child; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | final screenHeight = MediaQuery.of(context).size.height; 15 | final maxHeight = screenHeight - (screenHeight / 10); 16 | final theme = CosmosTheme.of(context); 17 | return MediaQuery.removePadding( 18 | context: context, 19 | removeTop: true, 20 | child: ConstrainedBox( 21 | constraints: BoxConstraints( 22 | maxHeight: maxHeight, 23 | ), 24 | child: Container( 25 | decoration: BoxDecoration( 26 | borderRadius: BorderRadius.vertical( 27 | top: Radius.elliptical( 28 | theme.radiusXL, 29 | theme.radiusXL * 1.1, 30 | ), 31 | ), 32 | color: theme.colors.chipBackground, 33 | ), 34 | child: child, 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/minimal_bottom_spacer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | /// adds vertical space equal to [padding]. on devices with system bottom padding (i.e: iphones without home button), 8 | /// it makes sure the total padding (system + [padding]) is no larger than [padding]. 9 | class MinimalBottomSpacer extends StatelessWidget { 10 | const MinimalBottomSpacer({ 11 | Key? key, 12 | this.padding, 13 | }) : super(key: key); 14 | 15 | final double? padding; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return SizedBox( 20 | height: minimalBottomPadding( 21 | context, 22 | padding ?? CosmosTheme.of(context).spacingL, 23 | ), 24 | ); 25 | } 26 | 27 | @override 28 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 29 | super.debugFillProperties(properties); 30 | properties.add(DoubleProperty('padding', padding)); 31 | } 32 | } 33 | 34 | double minimalBottomPadding(BuildContext context, double padding) { 35 | final bottom = MediaQuery.of(context).padding.bottom; 36 | return max(0, padding - bottom); 37 | } 38 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/mnemonic.dart: -------------------------------------------------------------------------------- 1 | import 'package:bip39/bip39.dart' as bip39; 2 | import 'package:flutter/foundation.dart'; 3 | 4 | String _generateMnemonic(int strength) => bip39.generateMnemonic(strength: strength); 5 | 6 | Future generateMnemonic({int strength = 256}) => compute(_generateMnemonic, strength); 7 | 8 | extension MnemonicWords on String { 9 | List splitToWords() => split(RegExp(r'\s+')) // 10 | .where((element) => element.isNotEmpty) 11 | .toList(); 12 | } 13 | 14 | /// Checks validity of [mnemonic] string and returns detailed error, if any. 15 | /// Returns null if no error detected 16 | MnemonicValidationError? validateMnemonic(String mnemonic) { 17 | if (mnemonic.isEmpty) { 18 | return MnemonicValidationError.MnemonicEmpty; 19 | } else if (!RegExp(r'^[a-zA-Z ]+$').hasMatch(mnemonic)) { 20 | return MnemonicValidationError.InvalidCharacter; 21 | } else if (![12, 24].contains(mnemonic.splitToWords().length)) { 22 | return MnemonicValidationError.WrongNumberOfWords; 23 | } else if (!bip39.validateMnemonic(mnemonic)) { 24 | return MnemonicValidationError.Unknown; 25 | } 26 | return null; 27 | } 28 | 29 | enum MnemonicValidationError { 30 | MnemonicEmpty, 31 | InvalidCharacter, 32 | WrongNumberOfWords, 33 | Unknown, 34 | } 35 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/account_public_info_serializer.dart: -------------------------------------------------------------------------------- 1 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 2 | 3 | //ignore: avoid_classes_with_only_static_members 4 | class AccountPublicInfoSerializer { 5 | static const _nameKey = 'name'; 6 | static const _chainIdKey = 'chain_id'; 7 | static const _publicAddressKey = 'public_address'; 8 | static const _accountIdKey = 'account_Id'; 9 | static const _additionalDataKey = 'additional_data'; 10 | static const _walletIdKey = 'wallet_Id'; 11 | 12 | static AccountPublicInfo fromMap(Map map) { 13 | return AccountPublicInfo( 14 | name: map[_nameKey] as String? ?? '', 15 | publicAddress: map[_publicAddressKey] as String? ?? '', 16 | accountId: map[_accountIdKey] as String? ?? map[_walletIdKey] as String? ?? '', 17 | chainId: map[_chainIdKey] as String? ?? '', 18 | additionalData: map[_additionalDataKey] as String?, 19 | ); 20 | } 21 | 22 | static Map toMap(AccountPublicInfo info) { 23 | return { 24 | _nameKey: info.name, 25 | _publicAddressKey: info.publicAddress, 26 | _accountIdKey: info.accountId, 27 | _chainIdKey: info.chainId, 28 | _additionalDataKey: info.additionalData, 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_qr_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:qr_flutter/qr_flutter.dart'; 5 | 6 | class CosmosQrImage extends StatelessWidget { 7 | const CosmosQrImage({ 8 | required this.data, 9 | this.borderRadius, 10 | this.padding = EdgeInsets.zero, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final String data; 15 | final BorderRadius? borderRadius; 16 | final EdgeInsets padding; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final theme = CosmosTheme.of(context); 21 | return ClipRRect( 22 | borderRadius: borderRadius ?? theme.borderRadiusL, 23 | child: QrImage( 24 | padding: padding, 25 | data: data, 26 | foregroundColor: theme.colors.text, 27 | ), 28 | ); 29 | } 30 | 31 | @override 32 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 33 | super.debugFillProperties(properties); 34 | properties 35 | ..add(StringProperty('data', data)) 36 | ..add(DiagnosticsProperty('radius', borderRadius)) 37 | ..add(DiagnosticsProperty('padding', padding)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/alan_credentials_serializer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:transaction_signing_gateway/alan/alan_credentials_serializer.dart'; 3 | import 'package:transaction_signing_gateway/alan/alan_private_account_credentials.dart'; 4 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 5 | 6 | void main() { 7 | group('Alan Serializer tests', () { 8 | final serializer = AlanCredentialsSerializer(); 9 | const credentials = AlanPrivateAccountCredentials( 10 | mnemonic: 'mnemonic', 11 | publicInfo: AccountPublicInfo( 12 | chainId: 'chainId', 13 | accountId: 'accountId', 14 | name: 'name', 15 | publicAddress: 'cosmos1ec4v57s7weuwatd36dgpjh8hj4gnj2cuut9sav', 16 | ), 17 | ); 18 | 19 | test('serializes and deserializes correctly', () { 20 | final jsonResult = serializer.toJson(credentials); 21 | expect(jsonResult.isRight(), true); 22 | final credentialsResult = jsonResult.flatMap(serializer.fromJson); 23 | expect(credentialsResult.isRight(), true); 24 | final alanCredsResult = credentialsResult.getOrElse(() => throw '') as AlanPrivateAccountCredentials; 25 | expect(alanCredsResult, credentials); 26 | }); 27 | }); 28 | } 29 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_back_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CosmosBackButton extends StatelessWidget { 6 | const CosmosBackButton({ 7 | Key? key, 8 | this.text = 'Back', 9 | this.onTap, 10 | this.color, 11 | }) : super(key: key); 12 | 13 | final VoidCallback? onTap; 14 | final String? text; 15 | final Color? color; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return CosmosTextButton( 20 | onTap: onTap ?? () => Navigator.of(context).pop(), 21 | text: text ?? '', 22 | iconTopSpacing: 2, 23 | leadingIcon: Image.asset( 24 | 'assets/images/big-arrow-left.png', 25 | package: packageName, 26 | width: 32, 27 | height: 32, 28 | scale: 1, 29 | color: color ?? CosmosTheme.of(context).colors.text, 30 | ), 31 | ); 32 | } 33 | 34 | @override 35 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 36 | super.debugFillProperties(properties); 37 | properties 38 | ..add(ObjectFlagProperty.has('onTap', onTap)) 39 | ..add(StringProperty('text', text)) 40 | ..add(ColorProperty('color', color)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: transaction_signing_gateway 2 | description: Transaction Signing gateway 3 | version: 0.0.1 4 | homepage: tendermint.com 5 | publish_to: 'none' # TODO publish it when ready 6 | 7 | environment: 8 | sdk: ">=2.16.1 <3.0.0" 9 | flutter: ">=2.0.5" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | equatable: ^2.0.3 15 | flutter_secure_storage: ^5.0.2 16 | biometric_storage: 4.0.0 17 | encrypt: ^5.0.1 18 | alan: ^0.40.2+1 19 | uuid: ^3.0.5 20 | decimal: ^1.5.0 21 | shared_preferences: ^2.0.11 22 | cosmos_utils: 23 | git: 24 | url: https://github.com/tendermint/flutter.git 25 | path: packages/cosmos_utils 26 | ref: main 27 | 28 | dependency_overrides: 29 | analyzer: 3.3.1 30 | 31 | dev_dependencies: 32 | flutter_test: 33 | sdk: flutter 34 | cosmos_lint: 35 | git: 36 | url: https://github.com/tendermint/flutter.git 37 | path: packages/cosmos_lint 38 | ref: main 39 | very_good_analysis: 2.4.0 40 | mocktail: 0.3.0 41 | 42 | ## convenient overrides for development to reference packages on local disk, just uncomment following lines and make sure 43 | ## it points to the location of the checked out tendermint/flutter repository 44 | #dependency_overrides: 45 | # cosmos_utils: 46 | # path: ../cosmos_utils 47 | # 48 | flutter: -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/app_version_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 3 | import 'package:cosmos_utils/app_info_provider.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class AppVersionText extends StatelessWidget { 8 | const AppVersionText({ 9 | required this.appInfoProvider, 10 | this.style, 11 | Key? key, 12 | }) : super(key: key); 13 | final AppInfoProvider appInfoProvider; 14 | final TextStyle? style; 15 | 16 | @override 17 | Widget build(BuildContext context) => FutureBuilder( 18 | future: appInfoProvider.getAppVersion(), 19 | builder: (context, snapshot) => Text( 20 | snapshot.data ?? '', 21 | style: style ?? 22 | CosmosTextTheme.copyMinus1Normal.copyWith( 23 | color: CosmosTheme.of(context).colors.text, 24 | ), 25 | ), 26 | ); 27 | 28 | @override 29 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 30 | super.debugFillProperties(properties); 31 | properties 32 | ..add(DiagnosticsProperty('appInfoProvider', appInfoProvider)) 33 | ..add(DiagnosticsProperty('style', style)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/mocks/test_memory_store.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:dartz/dartz.dart'; 3 | 4 | class TestMemoryStore implements PlainDataStore, SecureDataStore { 5 | final Map _values = {}; 6 | 7 | @override 8 | Future> clearAllData() async { 9 | _values.clear(); 10 | return right(true); 11 | } 12 | 13 | @override 14 | Future>> readAllPlainText() async => right({..._values}); 15 | 16 | @override 17 | Future> readPlainText({ 18 | required String key, 19 | }) async => 20 | right(_values[key]); 21 | 22 | @override 23 | Future> savePlainText({ 24 | required String key, 25 | required String? value, 26 | }) async { 27 | _values[key] = value; 28 | return right(unit); 29 | } 30 | 31 | @override 32 | Future> readSecureText({ 33 | required String key, 34 | }) => 35 | readPlainText(key: key); 36 | 37 | @override 38 | Future> saveSecureText({ 39 | required String key, 40 | required String? value, 41 | }) => 42 | savePlainText(key: key, value: value); 43 | } 44 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/account_derivation_failure.dart: -------------------------------------------------------------------------------- 1 | enum AccountDerivationFailType { 2 | invalidMnemonic, 3 | derivatorNotFound, 4 | unknown, 5 | } 6 | 7 | abstract class AccountDerivationFailure { 8 | AccountDerivationFailType get type; 9 | } 10 | 11 | class InvalidMnemonicFailure implements AccountDerivationFailure { 12 | const InvalidMnemonicFailure(this.cause, {this.stack}); 13 | 14 | final dynamic cause; 15 | final dynamic stack; 16 | 17 | @override 18 | AccountDerivationFailType get type => AccountDerivationFailType.invalidMnemonic; 19 | 20 | @override 21 | String toString() { 22 | return 'InvalidMnemonicFailure{cause: $cause\n${stack == null ? '' : 'stack:\n$stack'}'; 23 | } 24 | } 25 | 26 | class DerivatorNotFoundFailure implements AccountDerivationFailure { 27 | const DerivatorNotFoundFailure(); 28 | 29 | @override 30 | AccountDerivationFailType get type => AccountDerivationFailType.derivatorNotFound; 31 | 32 | @override 33 | String toString() => 'DerivatorNotFoundFailure'; 34 | } 35 | 36 | class UnknownNotFoundFailure implements AccountDerivationFailure { 37 | const UnknownNotFoundFailure(this.failure); 38 | 39 | final Object failure; 40 | 41 | @override 42 | AccountDerivationFailType get type => AccountDerivationFailType.unknown; 43 | 44 | @override 45 | String toString() => 'UnknownNotFoundFailure{fail: $failure}'; 46 | } 47 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/alan/alan_private_account_credentials.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/alan.dart' as alan; 2 | import 'package:equatable/equatable.dart'; 3 | import 'package:transaction_signing_gateway/alan/alan_credentials_serializer.dart'; 4 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 5 | import 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 6 | 7 | class AlanPrivateAccountCredentials extends Equatable implements PrivateAccountCredentials { 8 | const AlanPrivateAccountCredentials({ 9 | required this.mnemonic, 10 | required this.publicInfo, 11 | }); 12 | 13 | @override 14 | final String mnemonic; 15 | 16 | @override 17 | final AccountPublicInfo publicInfo; 18 | 19 | alan.Wallet alanAccount(alan.NetworkInfo networkInfo) => alan.Wallet.derive( 20 | mnemonic.split(' '), 21 | networkInfo, 22 | ); 23 | 24 | @override 25 | String get serializerIdentifier => AlanCredentialsSerializer.id; 26 | 27 | @override 28 | List get props => [ 29 | publicInfo, 30 | mnemonic, 31 | ]; 32 | 33 | AlanPrivateAccountCredentials copyWith({ 34 | String? mnemonic, 35 | AccountPublicInfo? publicInfo, 36 | }) { 37 | return AlanPrivateAccountCredentials( 38 | mnemonic: mnemonic ?? this.mnemonic, 39 | publicInfo: publicInfo ?? this.publicInfo, 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/cosmos_auth/test/mocks/mocks.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_auth/cosmos_auth.dart'; 2 | import 'package:cosmos_utils/cosmos_utils.dart'; 3 | import 'package:dartz/dartz.dart'; 4 | import 'package:mocktail/mocktail.dart'; 5 | 6 | class StubSecureDataStore implements SecureDataStore { 7 | Map map = {}; 8 | 9 | @override 10 | Future> clearAllData() async { 11 | map.clear(); 12 | return right(true); 13 | } 14 | 15 | @override 16 | Future> readSecureText({ 17 | required String key, 18 | }) async => 19 | right(map[key]); 20 | 21 | @override 22 | Future> saveSecureText({ 23 | required String key, 24 | required String? value, 25 | }) async { 26 | if (value == null) { 27 | map.remove(key); 28 | } else { 29 | map[key] = value; 30 | } 31 | return right(unit); 32 | } 33 | } 34 | 35 | class MockBiometrics extends Mock implements Biometrics { 36 | void mockAuthenticate({ 37 | required Either result, 38 | }) { 39 | when( 40 | () => authenticate( 41 | reason: any(named: 'reason'), 42 | biometricsOnly: any(named: 'biometricsOnly'), 43 | ), 44 | ).thenAnswer((invocation) async => result); 45 | } 46 | } 47 | 48 | class MockPasswordStore extends Mock implements PasswordStore {} 49 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/template/cosmos_balance_list_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/components/template/cosmos_balance_card.dart'; 2 | import 'package:cosmos_ui_components/models/balance.dart'; 3 | import 'package:cosmos_utils/cosmos_utils.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:flutter/material.dart'; 6 | 7 | class CosmosBalancesListView extends StatelessWidget { 8 | const CosmosBalancesListView({ 9 | required this.list, 10 | required this.onClicked, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final List list; 15 | final void Function(int) onClicked; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return ListView( 20 | children: list 21 | .mapIndexed( 22 | (index, balance) => CosmosBalanceCard( 23 | denomText: balance.denomText, 24 | amountDisplayText: balance.amountDisplayText, 25 | secondaryText: 'available ${balance.denomText.toUpperCase()}', 26 | ), 27 | ) 28 | .toList(), 29 | ); 30 | } 31 | 32 | @override 33 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 34 | super.debugFillProperties(properties); 35 | properties 36 | ..add(IterableProperty('list', list)) 37 | ..add(ObjectFlagProperty.has('onClicked', onClicked)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /starport_template/android/fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # This file contains the fastlane.tools configuration 2 | # You can find the documentation at https://docs.fastlane.tools 3 | # 4 | # For a list of all available actions, check out 5 | # 6 | # https://docs.fastlane.tools/actions 7 | # 8 | # For a list of all available plugins, check out 9 | # 10 | # https://docs.fastlane.tools/plugins/available-plugins 11 | # 12 | 13 | # Uncomment the line if you want fastlane to automatically update itself 14 | # update_fastlane 15 | 16 | default_platform(:android) 17 | 18 | platform :android do 19 | 20 | desc "deploys to firebase app distribution" 21 | lane :deploy_firebase do 22 | setup_ci 23 | releaseNotes = changelog_from_git_commits( 24 | commits_count: 10, 25 | date_format: "format:%d %b", 26 | pretty: "- (%cd) %s", 27 | merge_commit_filtering: "exclude_merges", 28 | quiet: true 29 | ).split("\n").select do |elem| 30 | !elem.include? "skip-ci" 31 | end[0...5].join("\n") 32 | 33 | print("RELEASE NOTES:\n") 34 | print(releaseNotes) 35 | 36 | firebase_app_distribution( 37 | app: ENV["ALPHA_ANDROID_FIREBASE_APP_ID"], 38 | android_artifact_path: "../build/app/outputs/flutter-apk/app-release.apk", 39 | groups: ENV["ALPHA_ANDROID_FIREBASE_TESTERS_GROUP"], 40 | release_notes: releaseNotes, 41 | firebase_cli_token: ENV["FIREBASE_TOKEN"] 42 | ) 43 | 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/chip_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class ChipText extends StatelessWidget { 7 | const ChipText({ 8 | required this.title, 9 | this.style, 10 | this.backgroundColor, 11 | Key? key, 12 | }) : super(key: key); 13 | final String title; 14 | final TextStyle? style; 15 | final Color? backgroundColor; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | final theme = CosmosTheme.of(context); 20 | return Container( 21 | padding: EdgeInsets.all(theme.spacingM), 22 | decoration: BoxDecoration( 23 | borderRadius: BorderRadius.circular(10), 24 | color: backgroundColor ?? theme.colors.chipBackground, 25 | ), 26 | child: Text( 27 | title, 28 | style: style ?? CosmosTextTheme.copyMinus1Normal.copyWith(color: theme.colors.text), 29 | ), 30 | ); 31 | } 32 | 33 | @override 34 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 35 | super.debugFillProperties(properties); 36 | properties 37 | ..add(StringProperty('title', title)) 38 | ..add(DiagnosticsProperty('style', style)) 39 | ..add(ColorProperty('backgroundColor', backgroundColor)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_image_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class CosmosImageButton extends StatelessWidget { 6 | const CosmosImageButton({ 7 | required this.asset, 8 | this.onTap, 9 | this.package, 10 | this.height = 24, 11 | this.width = 24, 12 | Key? key, 13 | }) : super(key: key); 14 | 15 | final String asset; 16 | final String? package; 17 | final double height; 18 | final double width; 19 | final VoidCallback? onTap; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return InkWell( 24 | onTap: onTap, 25 | child: SizedBox( 26 | height: height, 27 | width: width, 28 | child: Image.asset( 29 | asset, 30 | package: package, 31 | color: CosmosTheme.of(context).colors.text, 32 | ), 33 | ), 34 | ); 35 | } 36 | 37 | @override 38 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 39 | super.debugFillProperties(properties); 40 | properties 41 | ..add(DoubleProperty('width', width)) 42 | ..add(StringProperty('asset', asset)) 43 | ..add(DoubleProperty('height', height)) 44 | ..add(StringProperty('package', package)) 45 | ..add(ObjectFlagProperty.has('onTap', onTap)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/starport_button_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class StarportButtonBar extends StatelessWidget { 6 | const StarportButtonBar({ 7 | required this.onReceivePressed, 8 | required this.onSendPressed, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final VoidCallback onSendPressed; 13 | final VoidCallback onReceivePressed; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Padding( 18 | padding: EdgeInsets.symmetric( 19 | horizontal: CosmosTheme.of(context).spacingL, 20 | vertical: CosmosTheme.of(context).spacingXL, 21 | ), 22 | child: Row( 23 | children: [ 24 | Expanded(child: CosmosElevatedButton(text: 'Receive', onTap: onReceivePressed)), 25 | SizedBox(width: CosmosTheme.of(context).spacingL), 26 | Expanded(child: CosmosElevatedButton(text: 'Send', onTap: onSendPressed)), 27 | ], 28 | ), 29 | ); 30 | } 31 | 32 | @override 33 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 34 | super.debugFillProperties(properties); 35 | properties 36 | ..add(ObjectFlagProperty.has('onSendPressed', onSendPressed)) 37 | ..add(ObjectFlagProperty.has('onReceivePressed', onReceivePressed)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/loading_splash.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class LoadingSplash extends StatelessWidget { 7 | const LoadingSplash({ 8 | required this.text, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final String text; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Material( 17 | child: Padding( 18 | padding: EdgeInsets.symmetric(horizontal: CosmosTheme.of(context).spacingM), 19 | child: Center( 20 | child: Column( 21 | mainAxisAlignment: MainAxisAlignment.center, 22 | children: [ 23 | CircularProgressIndicator( 24 | color: CosmosTheme.of(context).colors.text, 25 | ), 26 | SizedBox(height: CosmosTheme.of(context).spacingL), 27 | Text( 28 | text, 29 | textAlign: TextAlign.center, 30 | style: CosmosTextTheme.title2Bold, 31 | ), 32 | ], 33 | ), 34 | ), 35 | ), 36 | ); 37 | } 38 | 39 | @override 40 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 41 | super.debugFillProperties(properties); 42 | properties.add(StringProperty('text', text)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/storage/key_info_storage.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:dartz/dartz.dart'; 3 | import 'package:transaction_signing_gateway/model/account_lookup_key.dart'; 4 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 5 | import 'package:transaction_signing_gateway/model/clear_credentials_failure.dart'; 6 | import 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 7 | import 'package:transaction_signing_gateway/model/transaction_signing_failure.dart'; 8 | 9 | abstract class KeyInfoStorage { 10 | Future> clearCredentials(); 11 | 12 | Future> getPrivateCredentials( 13 | AccountLookupKey accountLookupKey, 14 | ); 15 | 16 | Future> savePrivateCredentials({ 17 | required PrivateAccountCredentials accountCredentials, 18 | required String password, 19 | }); 20 | 21 | Future> deleteAccountCredentials({required AccountPublicInfo publicInfo}); 22 | 23 | Future> updatePublicAccountInfo({ 24 | required AccountPublicInfo info, 25 | }); 26 | 27 | Future>> getAccountsList(); 28 | 29 | Future> verifyLookupKey(AccountLookupKey accountLookupKey); 30 | } 31 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/back_up_account_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class BackupAccountCard extends StatelessWidget { 6 | const BackupAccountCard({ 7 | this.onTap, 8 | Key? key, 9 | }) : super(key: key); 10 | 11 | final VoidCallback? onTap; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | final theme = CosmosTheme.of(context); 16 | return InkWell( 17 | onTap: onTap, 18 | child: Container( 19 | margin: EdgeInsets.all(theme.spacingL), 20 | padding: EdgeInsets.symmetric(horizontal: theme.spacingL, vertical: theme.spacingM), 21 | decoration: BoxDecoration( 22 | borderRadius: BorderRadius.circular(10), 23 | border: Border.all(color: theme.colors.inactive), 24 | ), 25 | child: Row( 26 | children: [ 27 | Image.asset('assets/images/warning.png'), 28 | SizedBox(width: theme.spacingL), 29 | const Text('Back up your account'), 30 | const Spacer(), 31 | Image.asset('assets/images/arrow_right.png'), 32 | ], 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | @override 39 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 40 | super.debugFillProperties(properties); 41 | properties.add(ObjectFlagProperty.has('onTap', onTap)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /starport_template/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '13.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 | -------------------------------------------------------------------------------- /starport_template/lib/stores/transactions_store.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | import 'package:mobx/mobx.dart'; 3 | import 'package:starport_template/app_config.dart'; 4 | import 'package:starport_template/entities/transaction_history_item.dart'; 5 | import 'package:starport_template/utils/cosmos_transaction_history_loader.dart'; 6 | 7 | class TransactionsStore { 8 | TransactionsStore(this.appConfig); 9 | 10 | final AppConfig appConfig; 11 | final Observable _isTransactionHistoryLoading = Observable(false); 12 | final Observable _isTransactionHistoryError = Observable(false); 13 | 14 | final ObservableList transactionsList = ObservableList(); 15 | 16 | bool get isTransactionHistoryLoading => _isTransactionHistoryLoading.value; 17 | 18 | set isTransactionHistoryLoading(bool val) => Action(() => _isTransactionHistoryLoading.value = val)(); 19 | 20 | bool get isTransactionHistoryError => _isTransactionHistoryError.value; 21 | 22 | set isTransactionHistoryError(bool val) => Action(() => _isTransactionHistoryError.value = val)(); 23 | 24 | Future getTransactionHistory(String accountAddress) async { 25 | isTransactionHistoryLoading = true; 26 | try { 27 | final list = await CosmosTransactionHistoryLoader(appConfig).getTransactionHistory(accountAddress); 28 | transactionsList 29 | ..clear() 30 | ..addAll(list); 31 | } catch (ex, stack) { 32 | logError(ex, stack); 33 | isTransactionHistoryError = true; 34 | } 35 | isTransactionHistoryLoading = false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/transaction_signer.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:transaction_signing_gateway/model/transaction_signing_failure.dart'; 3 | import 'package:transaction_signing_gateway/transaction_signing_gateway.dart'; 4 | 5 | abstract class TransactionSigner { 6 | /// Signs the passed-in [UnsignedTransaction]. 7 | /// 8 | /// Returns [SignedTransaction] on successful sign, or [TransactionSigningFailure] otherwise. 9 | Future> sign({ 10 | required PrivateAccountCredentials privateCredentials, 11 | required UnsignedTransaction transaction, 12 | }); 13 | 14 | /// Checks if the passed-in transaction can be signed by this [TransactionSigner]. 15 | /// 16 | /// At least a type check must be performed on the passed transaction to determine if this transaction is meant 17 | /// for this signer, for example: `return unsignedTransaction is SaccoTransaction` 18 | bool canSign(UnsignedTransaction unsignedTransaction); 19 | } 20 | 21 | /// Default implementation for cases where given transaction could not be matched with any of the registered signers 22 | class NotFoundTransactionSigner implements TransactionSigner { 23 | @override 24 | bool canSign(UnsignedTransaction unsignedTransaction) => true; 25 | 26 | @override 27 | Future> sign({ 28 | required PrivateAccountCredentials privateCredentials, 29 | required UnsignedTransaction transaction, 30 | }) async => 31 | left(const TransactionSignerNotFoundFailure()); 32 | } 33 | -------------------------------------------------------------------------------- /starport_template/lib/pages/select_asset_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:starport_template/entities/balance.dart'; 5 | import 'package:starport_template/pages/transfer_asset_page.dart'; 6 | import 'package:starport_template/widgets/balance_card_list.dart'; 7 | 8 | class SelectAssetPage extends StatelessWidget { 9 | const SelectAssetPage({ 10 | required this.balancesList, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final List balancesList; 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | final theme = CosmosTheme.of(context); 19 | return Scaffold( 20 | backgroundColor: theme.colors.background, 21 | appBar: const CosmosAppBar(leading: CosmosBackButton(), title: 'Select Asset'), 22 | body: Padding( 23 | padding: EdgeInsets.only(top: CosmosTheme.of(context).spacingXXL), 24 | child: BalanceCardList( 25 | balancesList: balancesList, 26 | onTapItem: (balance) { 27 | Navigator.of(context).push( 28 | MaterialPageRoute( 29 | builder: (context) => TransferAssetPage(balance: balance), 30 | ), 31 | ); 32 | }, 33 | ), 34 | ), 35 | ); 36 | } 37 | 38 | @override 39 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 40 | super.debugFillProperties(properties); 41 | properties.add(IterableProperty('balancesList', balancesList)); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/content_state_switcher.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:flutter/foundation.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class ContentStateSwitcher extends StatelessWidget { 6 | const ContentStateSwitcher({ 7 | required this.contentChild, 8 | this.isLoading = false, 9 | this.isEmpty = false, 10 | this.isError = false, 11 | this.loadingChild = const ContentLoadingIndicator(), 12 | this.emptyChild = const SizedBox.shrink(), 13 | this.errorChild = const SizedBox.shrink(), 14 | Key? key, 15 | }) : super(key: key); 16 | 17 | final bool isLoading; 18 | final bool isEmpty; 19 | final bool isError; 20 | final Widget loadingChild; 21 | final Widget emptyChild; 22 | final Widget contentChild; 23 | 24 | final Widget errorChild; 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return AnimatedSwitcher( 29 | duration: const MediumDuration(), 30 | child: isLoading 31 | ? loadingChild 32 | : isError 33 | ? errorChild 34 | : isEmpty 35 | ? emptyChild 36 | : contentChild, 37 | ); 38 | } 39 | 40 | @override 41 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 42 | super.debugFillProperties(properties); 43 | properties 44 | ..add(DiagnosticsProperty('isEmpty', isEmpty)) 45 | ..add(DiagnosticsProperty('isLoading', isLoading)) 46 | ..add(DiagnosticsProperty('isError', isError)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/template/cosmos_balance_heading.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class BalanceHeading extends StatelessWidget { 5 | const BalanceHeading({ 6 | Key? key, 7 | }) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Padding( 12 | padding: EdgeInsets.symmetric( 13 | vertical: CosmosTheme.of(context).spacingXS, 14 | horizontal: CosmosTheme.of(context).spacingM, 15 | ), 16 | child: Row( 17 | children: [ 18 | Text( 19 | 'Balances', 20 | textAlign: TextAlign.start, 21 | style: Theme.of(context).textTheme.headline6, 22 | ), 23 | Container( 24 | margin: EdgeInsets.only(left: CosmosTheme.of(context).spacingS), 25 | padding: EdgeInsets.symmetric( 26 | horizontal: CosmosTheme.of(context).spacingM, 27 | vertical: CosmosTheme.of(context).spacingXS, 28 | ), 29 | decoration: BoxDecoration( 30 | color: Colors.blueGrey, 31 | borderRadius: BorderRadius.circular(CosmosTheme.of(context).radiusXL), 32 | ), 33 | child: Text( 34 | 'Cosmos', 35 | style: TextStyle( 36 | color: Colors.white, 37 | fontWeight: FontWeight.bold, 38 | fontSize: CosmosTheme.of(context).fontSizeS, 39 | ), 40 | ), 41 | ) 42 | ], 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/transaction_signing_failure.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/cosmos_utils.dart'; 2 | 3 | enum TransactionSigningFailType { 4 | userDeclined, 5 | invalidPassword, 6 | noTransactionSignerFound, 7 | accountCredentialsStorageFailure, 8 | unknown, 9 | } 10 | 11 | abstract class TransactionSigningFailure { 12 | TransactionSigningFailType get type; 13 | } 14 | 15 | class TransactionSignerNotFoundFailure implements TransactionSigningFailure { 16 | const TransactionSignerNotFoundFailure(); 17 | 18 | @override 19 | TransactionSigningFailType get type => TransactionSigningFailType.noTransactionSignerFound; 20 | } 21 | 22 | class UserDeclinedTransactionSignerFailure implements TransactionSigningFailure { 23 | const UserDeclinedTransactionSignerFailure(); 24 | 25 | @override 26 | TransactionSigningFailType get type => TransactionSigningFailType.userDeclined; 27 | } 28 | 29 | class InvalidPasswordTransactionSignerFailure implements TransactionSigningFailure { 30 | const InvalidPasswordTransactionSignerFailure(); 31 | 32 | @override 33 | TransactionSigningFailType get type => TransactionSigningFailType.invalidPassword; 34 | } 35 | 36 | class StorageProblemSigningFailure implements TransactionSigningFailure { 37 | const StorageProblemSigningFailure(this.failure); 38 | 39 | final CredentialsStorageFailure failure; 40 | 41 | @override 42 | TransactionSigningFailType get type => TransactionSigningFailType.accountCredentialsStorageFailure; 43 | 44 | @override 45 | String toString() { 46 | return 'StorageProblemSigningFailure{fail: $failure}'; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/test/test_utils/golden_test_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:alchemist/alchemist.dart'; 4 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:meta/meta.dart'; 7 | import 'package:mocktail_image_network/mocktail_image_network.dart'; 8 | 9 | final testThemes = { 10 | 'light': const CosmosThemeData.light(), 11 | 'dark': const CosmosThemeData.dark(), 12 | }; 13 | 14 | @isTest 15 | Future screenshotTest( 16 | String description, { 17 | required Widget Function(CosmosThemeData themeData) pageBuilder, 18 | bool skip = false, 19 | void Function()? setUp, 20 | List tags = const ['golden'], 21 | Map? themes, 22 | Duration timeout = const Duration(seconds: 5), 23 | }) async { 24 | setUp?.call(); 25 | return goldenTest( 26 | description, 27 | fileName: description, 28 | builder: () => GoldenTestGroup( 29 | children: (themes ?? testThemes).entries.map( 30 | (entry) { 31 | return DefaultAssetBundle( 32 | bundle: TestAssetBundle(), 33 | child: GoldenTestScenario( 34 | name: entry.key, 35 | child: pageBuilder(entry.value), 36 | ), 37 | ); 38 | }, 39 | ).toList(), 40 | ), 41 | tags: tags, 42 | skip: skip, 43 | pumpBeforeTest: (tester) => mockNetworkImages(() => precacheImages(tester)).timeout(timeout), 44 | pumpWidget: (tester, widget) => mockNetworkImages(() => tester.pumpWidget(widget)).timeout(timeout), 45 | ).timeout(timeout); 46 | } 47 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/transaction_signing_gateway.dart: -------------------------------------------------------------------------------- 1 | library transaction_signing_gateway; 2 | 3 | export 'package:transaction_signing_gateway/alan/alan_credentials_serializer.dart'; 4 | export 'package:transaction_signing_gateway/alan/alan_private_account_credentials.dart'; 5 | export 'package:transaction_signing_gateway/alan/alan_transaction.dart'; 6 | export 'package:transaction_signing_gateway/alan/alan_transaction_broadcaster.dart'; 7 | export 'package:transaction_signing_gateway/alan/alan_transaction_signer.dart'; 8 | export 'package:transaction_signing_gateway/encrypt/aes_cipher.dart'; 9 | export 'package:transaction_signing_gateway/encrypt/cipher.dart'; 10 | export 'package:transaction_signing_gateway/gateway/transaction_signing_gateway.dart'; 11 | export 'package:transaction_signing_gateway/model/account_public_info.dart'; 12 | export 'package:transaction_signing_gateway/model/private_account_credentials.dart'; 13 | export 'package:transaction_signing_gateway/model/private_account_credentials_serializer.dart'; 14 | export 'package:transaction_signing_gateway/model/signed_transaction.dart'; 15 | export 'package:transaction_signing_gateway/model/unsigned_transaction.dart'; 16 | export 'package:transaction_signing_gateway/storage/biometric_data_store.dart'; 17 | export 'package:transaction_signing_gateway/storage/cosmos_key_info_storage.dart'; 18 | export 'package:transaction_signing_gateway/storage/flutter_secure_storage_data_store.dart'; 19 | export 'package:transaction_signing_gateway/storage/key_info_storage.dart'; 20 | export 'package:transaction_signing_gateway/storage/shared_prefs_plain_data_store.dart'; 21 | export 'package:transaction_signing_gateway/transaction_signer.dart'; 22 | -------------------------------------------------------------------------------- /starport_template/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 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/account_public_info_serializer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | import 'package:transaction_signing_gateway/model/account_public_info.dart'; 3 | import 'package:transaction_signing_gateway/model/account_public_info_serializer.dart'; 4 | 5 | void main() { 6 | late AccountPublicInfo publicInfo; 7 | 8 | setUp(() { 9 | publicInfo = const AccountPublicInfo( 10 | name: 'a name', 11 | publicAddress: 'cosmos1wze8mn5nsgl9qrgazc6f92fve7m5e6psjcx2du', 12 | accountId: 'fc74d409-3945-4f53-ba76-a03b3cee7865', 13 | chainId: 'cosmoshub', 14 | additionalData: 'additional data', 15 | ); 16 | }); 17 | 18 | test('serializes account info', () async { 19 | final map = AccountPublicInfoSerializer.toMap(publicInfo); 20 | final info = AccountPublicInfoSerializer.fromMap(map); 21 | expect(map['name'], publicInfo.name); 22 | expect(map['chain_id'], publicInfo.chainId); 23 | expect(map['public_address'], publicInfo.publicAddress); 24 | expect(map['account_Id'], publicInfo.accountId); 25 | expect(map['additional_data'], publicInfo.additionalData); 26 | expect(info, publicInfo); 27 | }); 28 | 29 | test('serializes account info', () async { 30 | final infoWithoutAdditionalData = AccountPublicInfo( 31 | name: publicInfo.name, 32 | publicAddress: publicInfo.publicAddress, 33 | accountId: publicInfo.accountId, 34 | chainId: publicInfo.chainId, 35 | ); 36 | final map = AccountPublicInfoSerializer.toMap(infoWithoutAdditionalData); 37 | final info = AccountPublicInfoSerializer.fromMap(map); 38 | expect(map['additional_data'], null); 39 | expect(info.additionalData, null); 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | 13 | # Flutter/Dart/Pub related 14 | **/doc/api/ 15 | .dart_tool/ 16 | .flutter-plugins 17 | .flutter-plugins-dependencies 18 | .packages 19 | .pub-cache/ 20 | .pub/ 21 | /build/ 22 | .last_build_id 23 | */build/ 24 | 25 | 26 | # Web related 27 | lib/generated_plugin_registrant.dart 28 | 29 | # Symbolication related 30 | app.*.symbols 31 | 32 | # Obfuscation related 33 | app.*.map.json 34 | 35 | # Widget golden test failures 36 | **/failures/*.png 37 | 38 | # Exceptions to above rules. 39 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 40 | signaling_server/node_modules 41 | *.g.dart 42 | *.gen.dart 43 | *.freezed.dart 44 | app_component.config.dart 45 | router.gr.dart 46 | lib/generated 47 | .fvm 48 | !**/.fvm/fvm_config.json 49 | 50 | report.xml 51 | 52 | ##### INTELLIJ 53 | 54 | # User-specific stuff 55 | **/.idea/**/workspace.xml 56 | **/.idea/**/tasks.xml 57 | **/.idea/**/usage.statistics.xml 58 | **/.idea/**/dictionaries 59 | **/.idea/**/shelf 60 | 61 | 62 | # Generated files 63 | .idea/**/contentModel.xml 64 | 65 | # Sensitive or high-churn files 66 | **/.idea/**/dataSources/ 67 | **/.idea/**/dataSources.ids 68 | **/.idea/**/dataSources.local.xml 69 | **/.idea/**/sqlDataSources.xml 70 | **/.idea/**/dynamic.xml 71 | **/.idea/**/uiDesigner.xml 72 | **/.idea/**/dbnavigator.xml 73 | 74 | # Gradle 75 | **/.idea/**/gradle.xml 76 | **/.idea/**/libraries 77 | 78 | 79 | # auto-import. 80 | **/.idea/artifacts 81 | **/.idea/compiler.xml 82 | **/.idea/jarRepositories.xml 83 | **/.idea/modules.xml 84 | **/.idea/*.iml 85 | **/.idea/modules 86 | **/*.iml 87 | **/*.ipr 88 | **/misc.xml 89 | starport_template/ios/build 90 | -------------------------------------------------------------------------------- /starport_template/lib/app_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/alan.dart'; 2 | import 'package:grpc/grpc.dart'; 3 | 4 | class AppConfig { 5 | AppConfig({ 6 | this.lcdUrl = 'http://localhost', 7 | this.grpcUrl = 'http://localhost', 8 | this.lcdPort = '1317', 9 | this.grpcPort = '9090', 10 | this.prefixAddress = 'cosmos', 11 | }); 12 | 13 | /// Configure the LCD Url 14 | final String lcdUrl; 15 | 16 | /// Configure the GRPC Url 17 | final String grpcUrl; 18 | 19 | /// Configure the LCD Port 20 | final String lcdPort; 21 | 22 | /// Configure the GRPC Port 23 | final String grpcPort; 24 | 25 | /// Configure the address prefix 26 | final String prefixAddress; 27 | 28 | /// Configure the base api url 29 | String get baseApiUrl => '$lcdUrl:$lcdPort'; 30 | 31 | /// Network information of the Cosmos-based network. 32 | NetworkInfo get networkInfo => NetworkInfo( 33 | bech32Hrp: prefixAddress, 34 | lcdInfo: LCDInfo( 35 | host: lcdUrl, 36 | port: int.parse(lcdPort), 37 | ), 38 | grpcInfo: GRPCInfo( 39 | host: grpcUrl, 40 | port: int.parse(grpcPort), 41 | credentials: 42 | int.parse(grpcPort) == 443 ? const ChannelCredentials.secure() : const ChannelCredentials.insecure(), 43 | ), 44 | ); 45 | 46 | AppConfig copyWith({ 47 | String? lcdUrl, 48 | String? grpcUrl, 49 | String? lcdPort, 50 | String? grpcPort, 51 | String? prefixAddress, 52 | }) { 53 | return AppConfig( 54 | lcdUrl: lcdUrl ?? this.lcdUrl, 55 | grpcUrl: grpcUrl ?? this.grpcUrl, 56 | lcdPort: lcdPort ?? this.lcdPort, 57 | grpcPort: grpcPort ?? this.grpcPort, 58 | prefixAddress: prefixAddress ?? this.prefixAddress, 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/asset_portfolio_heading.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class AssetPortfolioHeading extends StatelessWidget { 7 | const AssetPortfolioHeading({ 8 | required this.title, 9 | required this.onTap, 10 | this.isCentered = false, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final String title; 15 | final VoidCallback onTap; 16 | final bool isCentered; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final theme = CosmosTheme.of(context); 21 | return Padding( 22 | padding: EdgeInsets.only(left: CosmosTheme.of(context).spacingL, top: theme.spacingM), 23 | child: Row( 24 | mainAxisAlignment: isCentered ? MainAxisAlignment.center : MainAxisAlignment.start, 25 | children: [ 26 | Text( 27 | title, 28 | style: CosmosTextTheme.title2Bold.copyWith( 29 | color: theme.colors.text, 30 | ), 31 | ), 32 | IconButton( 33 | icon: Icon( 34 | Icons.arrow_downward_sharp, 35 | size: theme.fontSizeXL, 36 | color: theme.colors.text, 37 | ), 38 | onPressed: onTap, 39 | ) 40 | ], 41 | ), 42 | ); 43 | } 44 | 45 | @override 46 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 47 | super.debugFillProperties(properties); 48 | properties 49 | ..add(ObjectFlagProperty.has('onTap', onTap)) 50 | ..add(StringProperty('title', title)) 51 | ..add(DiagnosticsProperty('isCentered', isCentered)); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/.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 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | -------------------------------------------------------------------------------- /packages/cosmos_auth/.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 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## Breaking changes after 2.0.3 2 | 3 | ### The following classes & properties have been refactored (`OldClassName` -> `NewClassName`) 4 | 5 | #### UI components 6 | 7 | * `CosmosWalletListItem` -> `CosmosAccountListItem` 8 | * `CosmosWalletsListView` -> `CosmosAccountsListView` 9 | 10 | #### UI related models 11 | 12 | * `WalletInfo` -> `AccountInfo` 13 | 14 | #### Files moved 15 | 16 | * `AccountInfo` class was previously located inside `cosmos_accounts_list_view.dart` which itself is renamed 17 | from `cosmos_wallets_list_view.dart` 18 | * Now `AccountInfo` class is located under `models` folder in a separate file named `account_info.dart` 19 | 20 | ## 2.0.3 - 2021-01-27 21 | 22 | ### Fixed 23 | 24 | * Paste button not enabling the continue button on asset transfer page 25 | * Fees token denom is always AKT 26 | * Ruby setup for deployment scripts in Github Actions 27 | 28 | ## 2.0.2 - 2022-01-25 29 | 30 | ### Added 31 | 32 | * Security screen to enable app lock and biometrics 33 | 34 | ### Fixed 35 | 36 | * Bug fixes and minor improvements 37 | 38 | ## [2.0.1](https://github.com/tendermint/flutter/compare/v2.0.0...v2.0.1) - 2021-12-17 39 | 40 | ### Fixed 41 | 42 | * Library references in Ignite template 43 | 44 | ## 2.0.0 - 2021-12-17 45 | 46 | ### Changed 47 | 48 | * Major design revamp for Ignite template 49 | 50 | ## 1.0.2 - 2021-09-20 51 | 52 | ### Fixed 53 | 54 | * Fix go proxy cache 55 | 56 | ## 1.0.1 - 2021-08-21 57 | 58 | ### Added 59 | 60 | * Support for dark theme 61 | 62 | ### Changed 63 | 64 | * Minimum Android SDK version to 18 65 | 66 | ### Fixed 67 | 68 | * Minor bug fixes 69 | 70 | ## 1.0.0 - 2021-08-17 71 | 72 | * Initial version of Ignite template 73 | 74 | ## 0.1.0 - 2021-08-03 75 | 76 | * Export ignite template as a Go module 77 | * TODO: Add more from the first release -------------------------------------------------------------------------------- /packages/cosmos_utils/.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 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/mocks/stub_shared_preferences.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class StubSharedPreferences implements SharedPreferences { 4 | final map = {}; 5 | 6 | @override 7 | Set getKeys() => map.keys.toSet(); 8 | 9 | @override 10 | String? getString(String key) => map[key]?.toString(); 11 | 12 | @override 13 | Future remove(String key) async { 14 | map[key] = null; 15 | return true; 16 | } 17 | 18 | @override 19 | Future setString(String key, String value) async { 20 | map[key] = value; 21 | return true; 22 | } 23 | 24 | @override 25 | Future clear() => throw UnimplementedError(); 26 | 27 | @override 28 | Future commit() => throw UnimplementedError(); 29 | 30 | @override 31 | bool containsKey(String key) => throw UnimplementedError(); 32 | 33 | @override 34 | Object? get(String key) => throw UnimplementedError(); 35 | 36 | @override 37 | bool? getBool(String key) => throw UnimplementedError(); 38 | 39 | @override 40 | double? getDouble(String key) => throw UnimplementedError(); 41 | 42 | @override 43 | int? getInt(String key) => throw UnimplementedError(); 44 | 45 | @override 46 | List? getStringList(String key) => throw UnimplementedError(); 47 | 48 | @override 49 | Future reload() => throw UnimplementedError(); 50 | 51 | @override 52 | Future setBool(String key, bool value) => throw UnimplementedError(); 53 | 54 | @override 55 | Future setDouble(String key, double value) => throw UnimplementedError(); 56 | 57 | @override 58 | Future setInt(String key, int value) => throw UnimplementedError(); 59 | 60 | @override 61 | Future setStringList(String key, List value) => throw UnimplementedError(); 62 | } 63 | -------------------------------------------------------------------------------- /packages/cosmos_node_client/.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 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/ephemeral 64 | **/ios/Flutter/app.flx 65 | **/ios/Flutter/app.zip 66 | **/ios/Flutter/flutter_assets/ 67 | **/ios/Flutter/flutter_export_environment.sh 68 | **/ios/ServiceDefinitions.json 69 | **/ios/Runner/GeneratedPluginRegistrant.* 70 | 71 | # Exceptions to above rules. 72 | !**/ios/**/default.mode1v3 73 | !**/ios/**/default.mode2v3 74 | !**/ios/**/default.pbxuser 75 | !**/ios/**/default.perspectivev3 76 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/extensions.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_utils/logger.dart'; 2 | import 'package:dartz/dartz.dart'; 3 | 4 | /// does... nothing ;) 5 | T? doNothing() { 6 | return null; 7 | } 8 | 9 | extension IterableExtensions on Iterable { 10 | /// maps the passed iterable with the mapper that accepts index and element. 11 | Iterable mapIndexed(T2 Function(int, T) mapper) { 12 | return toList() // 13 | .asMap() 14 | .map((key, value) => MapEntry(key, mapper(key, value))) 15 | .values; 16 | } 17 | 18 | T? firstOrNull({bool Function(T)? where}) { 19 | try { 20 | return firstWhere( 21 | (it) => where?.call(it) ?? true, 22 | ); 23 | // ignore: avoid_catching_errors 24 | } on StateError { 25 | return null; 26 | } 27 | } 28 | } 29 | 30 | /// Extensions for the Either, Future and MobX combinations 31 | extension AsyncEither on Future> { 32 | Future> mapError(L2 Function(L fail) errorMapper) async { 33 | return (await this).leftMap(errorMapper); 34 | } 35 | 36 | Future> mapSuccess(R2 Function(R response) responseMapper) async { 37 | return (await this).map(responseMapper); 38 | } 39 | 40 | Future> doOn({ 41 | void Function(L fail)? fail, 42 | void Function(R success)? success, 43 | }) async { 44 | try { 45 | (await this).fold(fail ?? (_) {}, success ?? (_) {}); 46 | return this; 47 | } catch (e, stack) { 48 | logError(e, stack); 49 | rethrow; 50 | } 51 | } 52 | 53 | Future asyncFold( 54 | R2 Function(L fail) fail, 55 | R2 Function(R success) success, 56 | ) async => 57 | (await this).fold(fail, success); 58 | 59 | Future getOrThrow() async => asyncFold( 60 | (l) => throw l as Object, 61 | (r) => r, 62 | ); 63 | } 64 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/sign_transaction_tab_view_item.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:starport_template/entities/balance.dart'; 6 | 7 | class SignTransactionTabViewItem extends StatelessWidget { 8 | const SignTransactionTabViewItem({ 9 | required this.text, 10 | required this.balance, 11 | required this.amount, 12 | Key? key, 13 | }) : super(key: key); 14 | 15 | final String text; 16 | final double amount; 17 | final Balance balance; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | final theme = CosmosTheme.of(context); 22 | return Padding( 23 | padding: EdgeInsets.symmetric(horizontal: theme.spacingL), 24 | child: Row( 25 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 26 | children: [ 27 | Text( 28 | text, 29 | style: CosmosTextTheme.titleS.copyWith( 30 | color: theme.colors.text, 31 | ), 32 | ), 33 | const Spacer(), 34 | Text( 35 | balance.amountWithDenomText, 36 | style: CosmosTextTheme.title1Medium.copyWith( 37 | color: theme.colors.text, 38 | ), 39 | ), 40 | SizedBox(width: theme.spacingL), 41 | CosmosTokenAvatar(text: balance.denom.text), 42 | ], 43 | ), 44 | ); 45 | } 46 | 47 | @override 48 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 49 | super.debugFillProperties(properties); 50 | properties 51 | ..add(DiagnosticsProperty('balance', balance)) 52 | ..add(DoubleProperty('amount', amount)) 53 | ..add(StringProperty('text', text)); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/test/shared_prefs_plain_data_store_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dartz/dartz.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:transaction_signing_gateway/storage/shared_prefs_plain_data_store.dart'; 4 | 5 | import 'mocks/stub_shared_preferences.dart'; 6 | 7 | void main() { 8 | late SharedPrefsPlainDataStore store; 9 | late StubSharedPreferences sharedPrefs; 10 | 11 | setUp(() { 12 | sharedPrefs = StubSharedPreferences(); 13 | store = SharedPrefsPlainDataStore(sharedPreferencesProvider: () async => sharedPrefs); 14 | }); 15 | // 16 | test('storing value should allow to retrieve it', () async { 17 | //GIVEN 18 | const key = 'key_of_complex_data'; 19 | const value = '{"some":"complex","value": true}'; 20 | 21 | //WHEN 22 | await store.savePlainText(key: key, value: value); 23 | 24 | //THEN 25 | expect(await store.readPlainText(key: key), right(value)); 26 | }); 27 | // 28 | test('store should not show data stored directly in the sharedPrefs', () async { 29 | //GIVEN 30 | const key = 'key_of_complex_data'; 31 | const value = '{"some":"complex","value": true}'; 32 | await sharedPrefs.setString('one', 'value'); 33 | await sharedPrefs.setString('two', 'value'); 34 | await sharedPrefs.setString('three', 'value'); 35 | 36 | //WHEN 37 | await store.savePlainText(key: key, value: value); 38 | final allTexts = await store.readAllPlainText(); 39 | 40 | //THEN 41 | expect(await store.readPlainText(key: key), right(value)); 42 | expect(allTexts.isRight(), true); 43 | expect(allTexts.getOrElse(() => {}), {key: value}); 44 | 45 | expect(await store.readPlainText(key: 'one'), right(null)); 46 | expect(await store.readPlainText(key: 'two'), right(null)); 47 | expect(await store.readPlainText(key: 'three'), right(null)); 48 | }); 49 | // 50 | } 51 | -------------------------------------------------------------------------------- /starport_template/lib/starport_app.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/alan.dart'; 2 | import 'package:cosmos_auth/auth/cosmos_auth.dart'; 3 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 4 | import 'package:cosmos_utils/cosmos_utils.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter_mobx/flutter_mobx.dart'; 7 | import 'package:starport_template/app_config.dart'; 8 | import 'package:starport_template/pages/routing_page.dart'; 9 | import 'package:starport_template/stores/accounts_store.dart'; 10 | import 'package:starport_template/stores/settings_store.dart'; 11 | import 'package:starport_template/stores/theme_store.dart'; 12 | import 'package:starport_template/stores/transactions_store.dart'; 13 | import 'package:transaction_signing_gateway/gateway/transaction_signing_gateway.dart'; 14 | 15 | class StarportApp extends StatelessWidget { 16 | const StarportApp({ 17 | Key? key, 18 | }) : super(key: key); 19 | 20 | static late TransactionSigningGateway signingGateway; 21 | static late AccountsStore accountsStore; 22 | static late TransactionsStore transactionsStore; 23 | static late AppConfig appConfig; 24 | static late NetworkInfo networkInfo; 25 | static late SecureDataStore secureDataStore; 26 | static late SettingsStore settingsStore; 27 | static late ThemeStore themeStore; 28 | static late CosmosAuth cosmosAuth; 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Observer( 33 | builder: (context) => CosmosTheme( 34 | brightness: themeStore.isDarkTheme ? Brightness.dark : Brightness.light, 35 | child: Builder( 36 | builder: (context) { 37 | return MaterialApp( 38 | title: 'Starport template', 39 | theme: CosmosTheme.of(context).buildFlutterTheme(), 40 | home: const RoutingPage(), 41 | ); 42 | }, 43 | ), 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /packages/cosmos_auth/lib/biometrics/biometrics.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_auth/model/biometric_type.dart' as model; 2 | import 'package:cosmos_auth/model/local_auth_failure.dart'; 3 | import 'package:cosmos_utils/cosmos_utils.dart'; 4 | import 'package:dartz/dartz.dart'; 5 | import 'package:local_auth/local_auth.dart'; 6 | 7 | class Biometrics { 8 | const Biometrics(); 9 | 10 | Future> authenticate({ 11 | String reason = "We want to make sure you're the owner of the device in order to secure your account data", 12 | bool biometricsOnly = false, 13 | }) async { 14 | try { 15 | final localAuth = LocalAuthentication(); 16 | if (await localAuth.canCheckBiometrics) { 17 | final result = await localAuth.authenticate( 18 | localizedReason: reason, 19 | biometricOnly: biometricsOnly, 20 | ); 21 | return right(result); 22 | } else { 23 | return left(const LocalAuthFailure.noBiometricsAvailable()); 24 | } 25 | } catch (ex, stack) { 26 | logError(ex, stack); 27 | return left(LocalAuthFailure.unknown(ex, stack)); 28 | } 29 | } 30 | 31 | Future>> getAvailableBiometrics() async { 32 | try { 33 | final biometrics = await LocalAuthentication().getAvailableBiometrics(); 34 | return right(biometrics.map(_biometricTypeFromLocalAuth).toList()); 35 | } catch (ex, stack) { 36 | logError(ex, stack); 37 | return left(LocalAuthFailure.unknown(ex, stack)); 38 | } 39 | } 40 | } 41 | 42 | model.BiometricType _biometricTypeFromLocalAuth(BiometricType type) { 43 | switch (type) { 44 | case BiometricType.face: 45 | return model.BiometricType.face; 46 | case BiometricType.fingerprint: 47 | return model.BiometricType.fingerprint; 48 | case BiometricType.iris: 49 | return model.BiometricType.iris; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /starport_template/lib/widgets/balance_card_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_ui_components.dart'; 2 | import 'package:cosmos_utils/amount_formatter.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:starport_template/entities/balance.dart'; 6 | 7 | class BalanceCardList extends StatelessWidget { 8 | const BalanceCardList({ 9 | required this.balancesList, 10 | this.onTapItem, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final List balancesList; 15 | final Function(Balance)? onTapItem; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return SingleChildScrollView( 20 | child: Column( 21 | children: balancesList 22 | .map( 23 | (balance) => Column( 24 | children: [ 25 | CosmosBalanceCard( 26 | denomText: balance.denom.text.toUpperCase(), 27 | amountDisplayText: formatAmount( 28 | balance.amount.value.toDouble(), 29 | symbol: '', 30 | ), 31 | secondaryText: balance.denom.text.toUpperCase(), 32 | onTap: onTapItem == null ? null : () => onTapItem!(balance), 33 | ), 34 | SizedBox(height: CosmosTheme.of(context).spacingL), 35 | SizedBox(height: CosmosTheme.of(context).spacingM), 36 | ], 37 | ), 38 | ) 39 | .toList(), 40 | ), 41 | ); 42 | } 43 | 44 | @override 45 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 46 | super.debugFillProperties(properties); 47 | properties 48 | ..add(ObjectFlagProperty.has('onTapItem', onTapItem)) 49 | ..add(IterableProperty('balancesList', balancesList)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /packages/transaction_signing_gateway/lib/model/account_public_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | 3 | class AccountPublicInfo extends Equatable { 4 | const AccountPublicInfo({ 5 | required this.name, 6 | required this.publicAddress, 7 | required this.accountId, 8 | required this.chainId, 9 | this.additionalData, 10 | }); 11 | 12 | /// a user-specified name to distinguish different accounts 13 | final String name; 14 | 15 | /// public hex address, for example "cosmos1ec4v57s7weuwatd36dgpjh8hj4gnj2cuut9sav" for cosmos-based chain 16 | /// or "0x9BCf3021B356F9352D3811fFCd4F778D63FdF208" for ethereum-based chain 17 | final String publicAddress; 18 | 19 | /// a uuid of the account credentials, must be generated by client apps when importing account info, 20 | /// for example using uuid package: 21 | /// Uuid().v4() 22 | final String accountId; 23 | 24 | /// Unique identifier for the blockchain that this account belongs to. 25 | /// This string can be whatever the developer finds suitable, for example: 26 | /// "ethereum", "atom", "akash", "foo" or "bar" :) 27 | final String chainId; 28 | 29 | /// optional additional data stored in an insecure way 30 | final String? additionalData; 31 | 32 | @override 33 | List get props => [ 34 | name, 35 | publicAddress, 36 | accountId, 37 | chainId, 38 | additionalData, 39 | ]; 40 | 41 | AccountPublicInfo copyWith({ 42 | String? name, 43 | String? publicAddress, 44 | String? accountId, 45 | String? chainId, 46 | String? additionalData, 47 | }) { 48 | return AccountPublicInfo( 49 | name: name ?? this.name, 50 | publicAddress: publicAddress ?? this.publicAddress, 51 | accountId: accountId ?? this.accountId, 52 | chainId: chainId ?? this.chainId, 53 | additionalData: additionalData ?? this.additionalData, 54 | ); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/info_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class InfoCard extends StatelessWidget { 7 | const InfoCard({ 8 | required this.text, 9 | Key? key, 10 | }) : super(key: key); 11 | 12 | final String text; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | final theme = CosmosTheme.of(context); 17 | return Container( 18 | decoration: BoxDecoration( 19 | color: theme.colors.cardBackground, 20 | borderRadius: BorderRadius.circular(12), 21 | ), 22 | child: Padding( 23 | padding: const EdgeInsets.only( 24 | left: 22, 25 | right: 22, 26 | top: 14, 27 | bottom: 20, 28 | ), 29 | child: Row( 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | children: [ 32 | Padding( 33 | padding: const EdgeInsets.only(top: 8), 34 | child: Container( 35 | width: 8, 36 | height: 8, 37 | decoration: BoxDecoration( 38 | shape: BoxShape.circle, 39 | color: theme.colors.text, 40 | ), 41 | ), 42 | ), 43 | const SizedBox(width: 20), 44 | Expanded( 45 | child: Text( 46 | text, 47 | style: CosmosTextTheme.copyMinus1Normal.copyWith(color: theme.colors.text), 48 | ), 49 | ) 50 | ], 51 | ), 52 | ), 53 | ); 54 | } 55 | 56 | @override 57 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 58 | super.debugFillProperties(properties); 59 | properties.add(StringProperty('text', text)); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /packages/cosmos_utils/lib/app_info_extractor.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:package_info/package_info.dart'; 4 | 5 | Future getAppInfo() async { 6 | final packageInfo = await PackageInfo.fromPlatform(); 7 | 8 | return AppInfo( 9 | packageName: packageInfo.packageName, 10 | appName: packageInfo.appName, 11 | buildNumber: packageInfo.buildNumber, 12 | version: packageInfo.version, 13 | ); 14 | } 15 | 16 | class AppInfo { 17 | AppInfo({ 18 | required this.packageName, 19 | required this.appName, 20 | required this.buildNumber, 21 | required this.version, 22 | }); 23 | 24 | AppInfo.empty() 25 | : packageName = '', 26 | appName = '', 27 | buildNumber = '', 28 | version = ''; 29 | 30 | factory AppInfo.fromJson(Map json) => AppInfo( 31 | packageName: json['packageName'] as String? ?? '', 32 | appName: json['appName'] as String? ?? '', 33 | buildNumber: json['buildNumber'] as String? ?? '', 34 | version: json['version'] as String? ?? '', 35 | ); 36 | 37 | final String appName; 38 | final String packageName; 39 | final String version; 40 | final String buildNumber; 41 | 42 | int get buildNumberInt => int.tryParse(buildNumber) ?? 0; 43 | 44 | Map toJson() => { 45 | 'appName': appName, 46 | 'packageName': packageName, 47 | 'version': version, 48 | 'buildNumber': buildNumber, 49 | }; 50 | 51 | String toJsonString() => jsonEncode(toJson()); 52 | 53 | AppInfo copyWith({ 54 | String? appName, 55 | String? packageName, 56 | String? version, 57 | String? buildNumber, 58 | }) { 59 | return AppInfo( 60 | appName: appName ?? this.appName, 61 | packageName: packageName ?? this.packageName, 62 | version: version ?? this.version, 63 | buildNumber: buildNumber ?? this.buildNumber, 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /starport_template/lib/utils/token_sender.dart: -------------------------------------------------------------------------------- 1 | import 'package:alan/alan.dart' as alan; 2 | import 'package:alan/proto/cosmos/bank/v1beta1/export.dart' as bank; 3 | import 'package:cosmos_utils/cosmos_utils.dart'; 4 | import 'package:flutter/foundation.dart'; 5 | import 'package:starport_template/entities/balance.dart'; 6 | import 'package:transaction_signing_gateway/model/account_lookup_key.dart'; 7 | import 'package:transaction_signing_gateway/transaction_signing_gateway.dart'; 8 | 9 | class TokenSender { 10 | TokenSender(this.transactionSigningGateway); 11 | 12 | TransactionSigningGateway transactionSigningGateway; 13 | 14 | Future sendCosmosMoney( 15 | AccountPublicInfo info, 16 | Balance balance, 17 | String toAddress, 18 | String password, 19 | ) async { 20 | final message = bank.MsgSend.create() 21 | ..fromAddress = info.publicAddress 22 | ..toAddress = toAddress; 23 | 24 | message.amount.add( 25 | alan.Coin.create() 26 | ..denom = balance.denom.text 27 | ..amount = balance.amount.value.toString(), 28 | ); 29 | 30 | final unsignedTransaction = UnsignedAlanTransaction(messages: [message]); 31 | 32 | final accountLookupKey = AccountLookupKey( 33 | accountId: info.accountId, 34 | chainId: info.chainId, 35 | password: password, 36 | ); 37 | 38 | final result = await transactionSigningGateway 39 | .signTransaction( 40 | transaction: unsignedTransaction, 41 | accountLookupKey: accountLookupKey, 42 | ) 43 | .mapError((error) => throw error) 44 | .flatMap( 45 | (signed) => transactionSigningGateway.broadcastTransaction( 46 | accountLookupKey: accountLookupKey, 47 | transaction: signed, 48 | ), 49 | ); 50 | result.fold( 51 | (fail) => throw fail as Object, 52 | (tx) => debugPrint('new TX hash: $tx'), 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: cosmos_ui_components 2 | description: Cosmos UI components 3 | version: 0.0.1 4 | homepage: tendermint.com 5 | publish_to: 'none' # TODO publish it when ready 6 | 7 | environment: 8 | sdk: ">=2.14.0 <3.0.0" 9 | flutter: ">=1.17.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | dotted_border: ^2.0.0+2 15 | pinput: ^1.2.2 16 | qr_flutter: ^4.0.0 17 | cosmos_utils: 18 | git: 19 | url: https://github.com/tendermint/flutter.git 20 | path: packages/cosmos_utils 21 | ref: main 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | alchemist: 0.3.3 27 | golden_toolkit: ^0.13.0 28 | mocktail_image_network: ^0.3.1 29 | cosmos_lint: 30 | git: 31 | url: https://github.com/tendermint/flutter.git 32 | path: packages/cosmos_lint 33 | ref: main 34 | 35 | #dependency_overrides: 36 | ## convenient overrides for development to reference packages on local disk, just uncomment following lines and make sure 37 | ## it points to the location of the checked out tendermint/flutter repository 38 | # cosmos_utils: 39 | # path: ../cosmos_utils 40 | 41 | 42 | flutter: 43 | assets: 44 | - assets/images/ 45 | 46 | fonts: 47 | - family: Inter 48 | fonts: 49 | - asset: lib/fonts/Inter-Thin.ttf 50 | weight: 100 51 | - asset: lib/fonts/Inter-ExtraLight.ttf 52 | weight: 200 53 | - asset: lib/fonts/Inter-Light.ttf 54 | weight: 300 55 | - asset: lib/fonts/Inter-Regular.ttf 56 | weight: 400 57 | - asset: lib/fonts/Inter-Medium.ttf 58 | weight: 500 59 | - asset: lib/fonts/Inter-SemiBold.ttf 60 | weight: 600 61 | - asset: lib/fonts/Inter-Bold.ttf 62 | weight: 700 63 | - asset: lib/fonts/Inter-ExtraBold.ttf 64 | weight: 800 65 | - asset: lib/fonts/Inter-Black.ttf 66 | weight: 900 -------------------------------------------------------------------------------- /starport_template/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Starport 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | starport_template 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | NSFaceIDUsageDescription 28 | We need access to FaceID in order to secure your wallet credentials so nobody can steal them 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /packages/cosmos_ui_components/lib/components/cosmos_circle_text_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:cosmos_ui_components/cosmos_text_theme.dart'; 2 | import 'package:cosmos_ui_components/cosmos_theme.dart'; 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class CosmosCircleTextButton extends StatelessWidget { 7 | const CosmosCircleTextButton({ 8 | required this.text, 9 | required this.asset, 10 | this.onTap, 11 | Key? key, 12 | }) : super(key: key); 13 | 14 | final String text; 15 | final String asset; 16 | final VoidCallback? onTap; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final theme = CosmosTheme.of(context); 21 | final isEnabled = onTap != null; 22 | return Padding( 23 | padding: EdgeInsets.symmetric( 24 | horizontal: theme.spacingL, 25 | vertical: theme.spacingM, 26 | ), 27 | child: InkWell( 28 | onTap: onTap, 29 | child: Row( 30 | children: [ 31 | SizedBox( 32 | height: 24, 33 | width: 24, 34 | child: Image.asset( 35 | asset, 36 | color: isEnabled ? theme.colors.text : theme.colors.inactive, 37 | ), 38 | ), 39 | SizedBox(width: theme.spacingL), 40 | Text( 41 | text, 42 | style: CosmosTextTheme.copy0Normal.copyWith( 43 | color: isEnabled ? theme.colors.text : theme.colors.inactive, 44 | ), 45 | ), 46 | ], 47 | ), 48 | ), 49 | ); 50 | } 51 | 52 | @override 53 | void debugFillProperties(DiagnosticPropertiesBuilder properties) { 54 | super.debugFillProperties(properties); 55 | properties 56 | ..add(StringProperty('asset', asset)) 57 | ..add(StringProperty('text', text)) 58 | ..add(ObjectFlagProperty.has('onTap', onTap)); 59 | } 60 | } 61 | --------------------------------------------------------------------------------