├── example
├── android
│ ├── settings_aar.gradle
│ ├── gradle.properties
│ ├── .gitignore
│ ├── 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
│ │ │ │ │ └── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── build.gradle
├── ios
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── .gitignore
│ └── Podfile
├── .metadata
├── README.md
├── .gitignore
├── pubspec.yaml
├── pubspec.lock
└── lib
│ └── main.dart
├── lib
├── types
│ └── tezos
│ │ ├── tezos_chain_types.dart
│ │ └── query_types.dart
├── tezster_dart.dart
├── chain
│ └── tezos
│ │ ├── tezos_language_util.dart
│ │ ├── tezos_node_reader.dart
│ │ ├── tezos_message_codec.dart
│ │ ├── tezos_message_utils.dart
│ │ └── tezos_node_writer.dart
├── models
│ ├── key_store_model.dart
│ └── operation_model.dart
├── reporting
│ ├── conseil_data_client.dart
│ ├── conseil_query_builder.dart
│ └── tezos
│ │ └── tezos_conseil_client.dart
├── helper
│ ├── constants.dart
│ ├── password_generater.dart
│ ├── http_helper.dart
│ └── generateKeys.dart
├── utils
│ ├── crypto_utils.dart
│ ├── sodium_utils.dart
│ └── gas_fee_calculator.dart
├── src
│ ├── soft-signer
│ │ └── soft_signer.dart
│ └── tezster_dart.dart
└── michelson_parser
│ ├── michelson_parser.dart
│ ├── grammar
│ ├── michelin_grammar_tokenizer.dart
│ └── michelson_grammar_tokenizer.dart
│ └── parser
│ └── nearley.dart
├── .metadata
├── .vscode
└── launch.json
├── pubspec.yaml
├── CHANGELOG.md
├── .gitignore
├── test
└── tezos_test.dart
├── pubspec.lock
└── README.md
/example/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/types/tezos/tezos_chain_types.dart:
--------------------------------------------------------------------------------
1 | enum TezosParameterFormat {
2 | Michelson,
3 | Micheline,
4 | MichelsonLambda,
5 | }
6 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/lib/tezster_dart.dart:
--------------------------------------------------------------------------------
1 | library tezster_dart;
2 |
3 | export 'src/tezster_dart.dart';
4 |
5 | export 'models/key_store_model.dart';
6 |
7 | export 'types/tezos/tezos_chain_types.dart';
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Tezsure/Tezster_dart/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 5f21edf8b66e31a39133177319414395cc5b5f48
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 69019664fe0ebe1e7e3028cdf7282d5887a5cb34
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Flutter",
9 | "request": "launch",
10 | "type": "dart"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/lib/chain/tezos/tezos_language_util.dart:
--------------------------------------------------------------------------------
1 |
2 | import 'package:tezster_dart/michelson_parser/michelson_parser.dart';
3 |
4 | class TezosLanguageUtil {
5 | static String translateMichelsonToMicheline(String code) {
6 | var result = MichelsonParser.parseMichelson(code);
7 | return result;
8 | }
9 |
10 | static String translateMichelineToHex(p) {
11 | return MichelsonParser.translateMichelineToHex(p);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/types/tezos/query_types.dart:
--------------------------------------------------------------------------------
1 | class QueryTypes {
2 | static Map conseilSortDirection = {'ASC': "asc", 'DESC': "desc"};
3 | static Map conseilOperator = {
4 | 'BETWEEN': "between",
5 | 'EQ': "eq",
6 | 'IN': "in",
7 | 'LIKE': "like",
8 | 'LT': "lt",
9 | 'BEFORE': "before",
10 | 'GT': "gt",
11 | 'AFTER': "after",
12 | 'STARTSWITH': "startsWith",
13 | 'ENDSWITH': "endsWith",
14 | 'ISNULL': "isnull"
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # tezster_dart example
2 |
3 | [](https://github.com/Tezsure)
4 | An example to demonstrate the tezster_dart package
5 |
6 | ## Getting Started
7 |
8 | * Clone the **example** directroy.
9 | * Change the directory to **example** in terminal/cmd.
10 | * Run the flutter project using `flutter run` command.
11 | * Check **debug console** for the output.
12 |
--------------------------------------------------------------------------------
/lib/models/key_store_model.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 |
3 | class KeyStoreModel {
4 | String publicKey;
5 | String secretKey;
6 | String publicKeyHash;
7 | var seed;
8 | String email;
9 | String password;
10 | String secret;
11 |
12 | KeyStoreModel({
13 | this.publicKey,
14 | this.secretKey,
15 | @required this.publicKeyHash,
16 | this.seed,
17 | this.secret,
18 | this.email,
19 | this.password,
20 | });
21 | }
22 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/lib/reporting/conseil_data_client.dart:
--------------------------------------------------------------------------------
1 | import 'package:tezster_dart/helper/http_helper.dart';
2 |
3 | class ConseilDataClient {
4 | static executeEntityQuery(
5 | serverInfo, platform, network, entity, query) async {
6 | var url = '${serverInfo['url']}/v2/data/$platform/$network/$entity';
7 |
8 | var res = await HttpHelper.performPostRequest(url, '', query, headers: {
9 | 'apiKey': serverInfo['apiKey'],
10 | 'cache': 'no-store',
11 | });
12 | return res;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/lib/helper/constants.dart:
--------------------------------------------------------------------------------
1 | class TezosConstants {
2 | static const OperationGroupWatermark = "03";
3 |
4 | static const DefaultTransactionStorageLimit = 496;
5 | static const DefaultTransactionGasLimit = 10600;
6 |
7 | static const DefaultDelegationFee = 1258;
8 | static const DefaultDelegationStorageLimit = 0;
9 | static const DefaultDelegationGasLimit = 1101;
10 |
11 | static const DefaultKeyRevealFee = 1270;
12 | static const DefaultKeyRevealStorageLimit = 0;
13 | static const DefaultKeyRevealGasLimit = 1100;
14 |
15 | static const HeadBranchOffset = 54;
16 | }
17 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | // Copyright 2014 The Flutter Authors. All rights reserved.
2 | // Use of this source code is governed by a BSD-style license that can be
3 | // found in the LICENSE file.
4 |
5 | include ':app'
6 |
7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
8 | def properties = new Properties()
9 |
10 | assert localPropertiesFile.exists()
11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12 |
13 | def flutterSdkPath = properties.getProperty("flutter.sdk")
14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
16 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.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 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: tezster_dart
2 | description: A flutter package which provides the functionalities to play around
3 | with tezos dApps
4 | version: 2.1.2-beta.2
5 | homepage: https://github.com/Tezsure/tezster_dart
6 | repository: https://github.com/Tezsure/tezster_dart
7 | issue_tracker: https://github.com/Tezsure/tezster_dart/issues
8 |
9 | environment:
10 | sdk: ">=2.3.0 <3.0.0"
11 |
12 | dependencies:
13 | flutter:
14 | sdk: flutter
15 | bip39: ^1.0.3
16 | blake2b: ^0.1.2
17 | bs58check: ^1.0.1
18 | convert: ^2.1.1
19 | crypto: ^2.1.5
20 | flutter_sodium: ^0.1.9
21 | password_hash: ^2.0.0
22 | unorm_dart: ^0.1.2
23 | ed25519_hd_key: ^1.1.0
24 |
25 | dev_dependencies:
26 | flutter_test:
27 | sdk: flutter
28 |
--------------------------------------------------------------------------------
/lib/utils/crypto_utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 | import 'package:tezster_dart/utils/sodium_utils.dart';
3 |
4 | class CryptoUtils {
5 | static Uint8List generateSaltForPwHash() {
6 | return SodiumUtils.salt();
7 | }
8 |
9 | static Uint8List encryptMessage(
10 | Uint8List message, String passphrase, Uint8List salt) {
11 | var keyBytes = SodiumUtils.pwhash(passphrase, salt);
12 | var nonce = SodiumUtils.nonce();
13 | var s = SodiumUtils.close(message, nonce, keyBytes);
14 |
15 | return new Uint8List.fromList(nonce.toList() + s.toList());
16 | }
17 |
18 | static Uint8List decryptMessage(message, passphrase, salt) {
19 | var keyBytes = SodiumUtils.pwhash(passphrase, salt);
20 | return SodiumUtils.open(message, keyBytes);
21 | }
22 |
23 | static Uint8List signDetached(Uint8List simpleHash, Uint8List key) {
24 | return SodiumUtils.sign(simpleHash, key);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/helper/password_generater.dart:
--------------------------------------------------------------------------------
1 | import 'dart:math';
2 |
3 | import 'package:flutter/cupertino.dart';
4 |
5 | class PasswordGenerator {
6 |
7 | static String generatePassword(
8 | {@required double length,
9 | bool isWithLetters,
10 | bool isWithUppercase,
11 | bool isWithNumbers,
12 | bool isWithSpecial}) {
13 | String _lowerCaseLetters = "abcdefghijklmnopqrstuvwxyz";
14 | String _upperCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
15 | String _numbers = "0123456789";
16 | String _special = r'!@#$%^&*()+_-=}{[]|:;"/?.><,`~';
17 |
18 | String _allowedChars = "";
19 |
20 | _allowedChars += (isWithLetters ? _lowerCaseLetters : '');
21 | _allowedChars += (isWithUppercase ? _upperCaseLetters : '');
22 | _allowedChars += (isWithNumbers ? _numbers : '');
23 | _allowedChars += (isWithSpecial ? _special : '');
24 |
25 | int i = 0;
26 | String _result = "";
27 |
28 | while (i < length.round()) {
29 | int randomInt = Random.secure().nextInt(_allowedChars.length);
30 | _result += _allowedChars[randomInt];
31 | i++;
32 | }
33 |
34 | return _result;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # [2.1.2-beta.2]
2 |
3 | * Restore Keys from secret-key
4 | * Restore Keys from mnemonic and derivationPath.
5 |
6 | # [2.1.2-beta.1]
7 |
8 | * Operation Gas fee calculator optimisation
9 | * Michelson grammar improvements
10 | * Minor bug fixes
11 |
12 | # [2.1.2-beta]
13 |
14 | * Support for florence mainnet and testnet
15 | * Operation Gas fee calculator
16 |
17 | # [2.1.1]
18 |
19 | * Deploy contract
20 | * Call contract
21 | * Operation confirmation
22 | * Activating a fundraiser account
23 | * Reveal an account
24 |
25 | # [2.1.1-beta.2]
26 |
27 | * Activating a fundraiser account
28 | * Reveal an account
29 |
30 | # [2.1.1-beta]
31 |
32 | * Fix for revelation of an account Ref #12
33 |
34 | # [2.1.0-beta]
35 |
36 | * Deploy contract
37 | * Call contract
38 | * Operation confirmation
39 | * Fix for revelation of an account Ref #12
40 |
41 | # [2.0.0]
42 |
43 | * Dependencies update.
44 | * Added Get Balance.
45 | * Added Transfer Balance.
46 | * Added Delegate an Account.
47 |
48 | # [1.0.1]
49 |
50 | * Dependencies update.
51 |
52 | # [1.0.0]
53 |
54 | Initial version of library.
55 |
56 | * Functions added:
57 | * Generate mnemonics.
58 | * Generate keys from mnemonic.
59 | * Generate keys from mnemonics and passphrase.
60 | * Sign Operation Group.
61 | * Unlock fundraiser identity.
62 |
--------------------------------------------------------------------------------
/lib/helper/http_helper.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 | import 'dart:io';
3 |
4 | class HttpHelper {
5 | static Future performPostRequest(server, command, payload,
6 | {Map headers}) async {
7 | HttpClient httpClient = new HttpClient();
8 | HttpClientRequest request = await httpClient.postUrl(
9 | command.isEmpty ? Uri.parse(server) : Uri.parse('$server/$command'));
10 | request.headers.set('content-type', 'application/json');
11 | if (headers == null) {
12 | request.add(utf8.encode(json.encode(payload)));
13 | } else {
14 | headers.entries.forEach(
15 | (header) => request.headers.add(header.key, header.value),
16 | );
17 | request.headers.add('body', json.encode(payload));
18 | request.add(utf8.encode(json.encode(payload)));
19 | }
20 | HttpClientResponse response = await request.close();
21 | String reply = await response.transform(utf8.decoder).join();
22 | httpClient.close();
23 | return reply;
24 | }
25 |
26 | static Future performGetRequest(server, command) async {
27 | HttpClient httpClient = new HttpClient();
28 | HttpClientRequest request =
29 | await httpClient.getUrl(Uri.parse('$server/$command'));
30 | HttpClientResponse response = await request.close();
31 | String reply = await response.transform(utf8.decoder).join();
32 | httpClient.close();
33 | return jsonDecode(reply);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/lib/utils/sodium_utils.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 |
3 | import 'package:flutter_sodium/flutter_sodium.dart';
4 |
5 | class SodiumUtils {
6 | static Uint8List rand(length) {
7 | return Sodium.randombytesBuf(length);
8 | }
9 |
10 | static Uint8List salt() {
11 | return Uint8List.fromList(rand(Sodium.cryptoPwhashSaltbytes).toList());
12 | }
13 |
14 | static Uint8List pwhash(String passphrase, Uint8List salt) {
15 | return Sodium.cryptoPwhash(
16 | Sodium.cryptoBoxSeedbytes,
17 | Uint8List.fromList(passphrase.codeUnits),
18 | salt,
19 | 4,
20 | 33554432,
21 | Sodium.cryptoPwhashAlgArgon2i13);
22 | }
23 |
24 | static Uint8List nonce() {
25 | return rand(Sodium.cryptoBoxNoncebytes);
26 | }
27 |
28 | static Uint8List close(
29 | Uint8List message, Uint8List nonce, Uint8List keyBytes) {
30 | return Sodium.cryptoSecretboxEasy(message, nonce, keyBytes);
31 | }
32 |
33 | static Uint8List open(Uint8List nonceAndCiphertext, Uint8List key) {
34 | var nonce = nonceAndCiphertext.sublist(0, Sodium.cryptoSecretboxNoncebytes);
35 | var ciphertext =
36 | nonceAndCiphertext.sublist(Sodium.cryptoSecretboxNoncebytes);
37 |
38 | return Sodium.cryptoSecretboxOpenEasy(ciphertext, nonce, key);
39 | }
40 |
41 | static Uint8List sign(Uint8List simpleHash, Uint8List key) {
42 | return Sodium.cryptoSignDetached(simpleHash, key);
43 | }
44 |
45 | static KeyPair publicKey(Uint8List sk) {
46 | var seed = Sodium.cryptoSignEd25519SkToSeed(sk);
47 | return Sodium.cryptoSignSeedKeypair(seed);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/lib/helper/generateKeys.dart:
--------------------------------------------------------------------------------
1 | import 'dart:typed_data';
2 | import 'package:blake2b/blake2b_hash.dart';
3 | import 'package:convert/convert.dart';
4 | import 'package:bs58check/bs58check.dart' as bs58check;
5 |
6 | class GenerateKeys {
7 | static String computeKeyHash(
8 | Uint8List publicKey,
9 | ) {
10 | Uint8List blake2bHash = Blake2bHash.hashWithDigestSize(160, publicKey);
11 | String uintToString = String.fromCharCodes(blake2bHash);
12 | String stringToHexString = hex.encode(uintToString.codeUnits);
13 | String finalStringToDecode = "06a19f" + stringToHexString;
14 | List listOfHexDecodedInt = hex.decode(finalStringToDecode);
15 | String publicKeyHash = bs58check.encode(listOfHexDecodedInt);
16 | return publicKeyHash;
17 | }
18 |
19 | static String readKeysWithHint(
20 | Uint8List key,
21 | String hint,
22 | ) {
23 | String uint8ListToString = String.fromCharCodes(key);
24 | String stringToHexString = hex.encode(uint8ListToString.codeUnits);
25 | String concatinatingHexStringWithHint = hint + stringToHexString;
26 | List convertingHexStringToListOfInt =
27 | hex.decode(concatinatingHexStringWithHint);
28 | String base58String = bs58check.encode(convertingHexStringToListOfInt);
29 | return base58String;
30 | }
31 |
32 | static Uint8List writeKeyWithHint(
33 | String key,
34 | String hint,
35 | ) {
36 | if (hint == 'edsk' ||
37 | hint == 'edpk' ||
38 | hint == 'sppk' ||
39 | hint == 'p2pk' ||
40 | hint == '2bf64e07' ||
41 | hint == '0d0f25d9') {
42 | return bs58check.decode(key).sublist(4);
43 | } else
44 | throw Exception("Unrecognized key hint, '$hint'");
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
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/flutter_tools/test/data/dart_dependencies_test/**/.packages
76 |
--------------------------------------------------------------------------------
/lib/reporting/conseil_query_builder.dart:
--------------------------------------------------------------------------------
1 | import 'package:tezster_dart/types/tezos/query_types.dart';
2 |
3 | class ConseilQueryBuilder {
4 | static blankQuery() {
5 | return {
6 | 'fields': new List(),
7 | 'predicates': new List(),
8 | 'orderBy': new List(),
9 | 'aggregation': new List(),
10 | 'limit': 100
11 | };
12 | }
13 |
14 | static setLimit(query, limit) {
15 | if (limit < 1) {
16 | throw new Exception('Limit cannot be less than one.');
17 | }
18 | var q = query;
19 | q['limit'] = limit;
20 | return q;
21 | }
22 |
23 | static addOrdering(query, field, {direction}) {
24 | if (direction == null) direction = QueryTypes.conseilSortDirection['ASC'];
25 | var q = query;
26 | q['orderBy'].add({'field': field, 'direction': direction});
27 | return q;
28 | }
29 |
30 | static addPredicate(query, field, operation, values,
31 | {invert = false, group = ''}) {
32 | if (group == null) group = '';
33 | if (operation == QueryTypes.conseilOperator['BETWEEN'] &&
34 | values.length != 2) {
35 | throw new Exception('BETWEEN operation requires a list of two values.');
36 | } else if (operation == QueryTypes.conseilOperator['IN'] &&
37 | values.length < 2) {
38 | throw new Exception(
39 | 'IN operation requires a list of two or more values.');
40 | } else if (values.length != 1 &&
41 | operation != QueryTypes.conseilOperator['IN'] &&
42 | operation != QueryTypes.conseilOperator['BETWEEN'] &&
43 | operation != QueryTypes.conseilOperator['ISNULL']) {
44 | throw new Exception('invalid values list for $operation.');
45 | }
46 | var q = query;
47 | q['predicates'].add({
48 | 'field': field,
49 | 'operation': operation ?? '',
50 | 'set': values ,
51 | 'inverse': invert,
52 | 'group': group ?? '',
53 | });
54 | return q;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/lib/chain/tezos/tezos_node_reader.dart:
--------------------------------------------------------------------------------
1 | import 'package:tezster_dart/helper/http_helper.dart';
2 |
3 | class TezosNodeReader {
4 | static Future getCounterForAccount(String server, String publicKeyHash,
5 | {String chainid = 'main'}) async {
6 | var response = await HttpHelper.performGetRequest(server,
7 | 'chains/$chainid/blocks/head/context/contracts/$publicKeyHash/counter');
8 | return int.parse(response.toString().replaceAll('"', ''), radix: 10);
9 | }
10 |
11 | static Future isManagerKeyRevealedForAccount(
12 | String server, String publicKeyHash) async {
13 | var managerKey =
14 | await getAccountManagerForBlock(server, 'head', publicKeyHash);
15 | return managerKey.length > 0;
16 | }
17 |
18 | static Future getAccountManagerForBlock(
19 | String server, String block, String publicKeyHash,
20 | {String chainid = 'main'}) async {
21 | var response = await HttpHelper.performGetRequest(server,
22 | 'chains/$chainid/blocks/$block/context/contracts/$publicKeyHash/manager_key');
23 | return response != null ? response.toString() : '';
24 | }
25 |
26 | static Future