diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 6b4c0f7..f2872cf 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 8.0
+ 9.0
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
new file mode 100644
index 0000000..4c70286
--- /dev/null
+++ b/example/ios/Podfile.lock
@@ -0,0 +1,22 @@
+PODS:
+ - Flutter (1.0.0)
+ - flutter_sodium (0.0.1):
+ - Flutter
+
+DEPENDENCIES:
+ - Flutter (from `Flutter`)
+ - flutter_sodium (from `.symlinks/plugins/flutter_sodium/ios`)
+
+EXTERNAL SOURCES:
+ Flutter:
+ :path: Flutter
+ flutter_sodium:
+ :path: ".symlinks/plugins/flutter_sodium/ios"
+
+SPEC CHECKSUMS:
+ Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
+ flutter_sodium: c84426b4de738514b5b66cfdeb8a06634e72fe0b
+
+PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
+
+COCOAPODS: 1.10.1
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index d59cc08..6976c4c 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -13,6 +13,7 @@
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
+ E912E6A76ADEDE241BCDB735 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B45E7A4745AF4B8EE477D69 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@@ -31,7 +32,10 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
+ 1B45E7A4745AF4B8EE477D69 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 1E50678272CB049C5F39A78C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
+ 6BFB775485EAB3650B8CB319 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
@@ -42,6 +46,7 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ BD336D74DB5A87C0740ADDFE /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -49,6 +54,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ E912E6A76ADEDE241BCDB735 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -72,6 +78,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
+ BD826F3CE00D16E2532AF5CC /* Pods */,
+ D06F5E3A6439218479EA2FC5 /* Frameworks */,
);
sourceTree = "";
};
@@ -106,6 +114,25 @@
name = "Supporting Files";
sourceTree = "";
};
+ BD826F3CE00D16E2532AF5CC /* Pods */ = {
+ isa = PBXGroup;
+ children = (
+ 6BFB775485EAB3650B8CB319 /* Pods-Runner.debug.xcconfig */,
+ BD336D74DB5A87C0740ADDFE /* Pods-Runner.release.xcconfig */,
+ 1E50678272CB049C5F39A78C /* Pods-Runner.profile.xcconfig */,
+ );
+ name = Pods;
+ path = Pods;
+ sourceTree = "";
+ };
+ D06F5E3A6439218479EA2FC5 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1B45E7A4745AF4B8EE477D69 /* Pods_Runner.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -113,12 +140,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
+ 6A8D1B8E0412D0033A7D127B /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+ 8628E441B6D41CA9126B84D0 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -191,6 +220,45 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
+ 6A8D1B8E0412D0033A7D127B /* [CP] Check Pods Manifest.lock */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ );
+ inputPaths = (
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+ "${PODS_ROOT}/Manifest.lock",
+ );
+ name = "[CP] Check Pods Manifest.lock";
+ outputFileListPaths = (
+ );
+ outputPaths = (
+ "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+ showEnvVarsInLog = 0;
+ };
+ 8628E441B6D41CA9126B84D0 /* [CP] Embed Pods Frameworks */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+ );
+ name = "[CP] Embed Pods Frameworks";
+ outputFileListPaths = (
+ "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+ showEnvVarsInLog = 0;
+ };
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
@@ -280,7 +348,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
@@ -362,7 +430,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -411,7 +479,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 1d526a1..919434a 100644
--- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata
index 1d526a1..21a3cc1 100644
--- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -4,4 +4,7 @@
+
+
diff --git a/example/lib/main.dart b/example/lib/main.dart
index 71e321f..3ae1200 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -44,7 +44,7 @@ class _MyAppState extends State {
// Accessing: private key ===> identity[0] | public key ===> identity[1] | public Key Hash ===> identity[2] all of type string.
//Restore account from secret key
- List restoredKeys = TezsterDart.getKeysFromSecretKey(
+ List restoredKeys = TezsterDart.getKeysFromSecretKey(
"edskRrDH2TF4DwKU1ETsUjyhxPC8aCTD6ko5YDguNkJjRb3PiBm8Upe4FGFmCrQqzSVMDLfFN22XrQXATcA3v41hWnAhymgQwc");
print("Restored account keys ===> $restoredKeys");
// restoredKeys ===> [privateKey, publicKey, publicKeyHash]
@@ -233,8 +233,8 @@ class _MyAppState extends State {
);
var faucetKeys = await TezsterDart.unlockFundraiserIdentity(
- email: faucetKeyStore.email,
- passphrase: faucetKeyStore.password,
+ email: faucetKeyStore.email!,
+ passphrase: faucetKeyStore.password!,
mnemonic: faucetKeyStore.seed.join(' '));
faucetKeyStore
..publicKey = faucetKeys[1]
@@ -244,7 +244,7 @@ class _MyAppState extends State {
TezsterDart.writeKeyWithHint(faucetKeyStore.secretKey, 'edsk'));
var activationOperationResult =
await TezsterDart.sendIdentityActivationOperation(server,
- activationOperationSigner, faucetKeyStore, faucetKeyStore.secret);
+ activationOperationSigner, faucetKeyStore, faucetKeyStore.secret!);
print('${activationOperationResult['operationGroupID']}');
//Reveal an account
@@ -266,7 +266,16 @@ class _MyAppState extends State {
@override
void initState() {
super.initState();
- tezosWalletUtil();
+ // tezosWalletUtil();
+ readContract();
+ }
+
+ void readContract() async {
+ // var contractAddress = 'KT1RJ6PbjHpwc3M5rw5s2Nbmefwbuwbdxton';
+ // var contract = await TezsterDart.getContractStorage(
+ // "https://edonet.smartpy.io", "KT1CoQ5cd6hkPCxeCj3N5uPWztKfjn4kqXVm");
+ // print(contract);
+ TezsterDart.exp("KT1CoQ5cd6hkPCxeCj3N5uPWztKfjn4kqXVm");
}
@override
@@ -277,9 +286,14 @@ class _MyAppState extends State {
body: Padding(
padding: EdgeInsets.all(8.0),
child: Center(
- child: Text(
- "Welcome to Tezster_dart package.\n Please check the debug console for the outputs",
- textAlign: TextAlign.center,
+ child: InkWell(
+ onTap: () {
+ readContract();
+ },
+ child: Text(
+ "Welcome to Tezster_dart package.\n Please check the debug console for the outputs",
+ textAlign: TextAlign.center,
+ ),
),
),
),
diff --git a/example/pubspec.lock b/example/pubspec.lock
index dbfafda..faae489 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -7,21 +7,21 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
- version: "2.5.0"
+ version: "2.7.0"
bip39:
dependency: transitive
description:
name: bip39
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.4"
+ version: "1.0.6"
blake2b:
dependency: transitive
description:
name: blake2b
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.2"
+ version: "0.2.1"
boolean_selector:
dependency: transitive
description:
@@ -35,7 +35,7 @@ packages:
name: bs58check
url: "https://pub.dartlang.org"
source: hosted
- version: "1.0.1"
+ version: "1.0.2"
characters:
dependency: transitive
description:
@@ -49,7 +49,7 @@ packages:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
- version: "1.2.0"
+ version: "1.3.1"
clock:
dependency: transitive
description:
@@ -64,27 +64,34 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
+ conduit_password_hash:
+ dependency: transitive
+ description:
+ name: conduit_password_hash
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.0.11"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.1"
+ version: "3.0.1"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
- version: "2.1.5"
+ version: "3.0.1"
cryptography:
dependency: transitive
description:
name: cryptography
url: "https://pub.dartlang.org"
source: hosted
- version: "1.4.1"
+ version: "2.0.2"
cupertino_icons:
dependency: "direct main"
description:
@@ -98,7 +105,7 @@ packages:
name: ed25519_hd_key
url: "https://pub.dartlang.org"
source: hosted
- version: "1.1.0"
+ version: "2.1.0"
fake_async:
dependency: transitive
description:
@@ -112,14 +119,14 @@ packages:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.3"
+ version: "1.1.2"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
- version: "0.10.11"
+ version: "1.0.0"
flutter:
dependency: "direct main"
description: flutter
@@ -131,26 +138,31 @@ packages:
name: flutter_sodium
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.11"
+ version: "0.2.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
+ flutter_web_plugins:
+ dependency: transitive
+ description: flutter
+ source: sdk
+ version: "0.0.0"
hex:
dependency: transitive
description:
name: hex
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.2"
+ version: "0.2.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
- version: "0.6.2"
+ version: "0.6.3"
matcher:
dependency: transitive
description:
@@ -164,14 +176,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
- version: "1.3.0"
- password_hash:
- dependency: transitive
- description:
- name: password_hash
- url: "https://pub.dartlang.org"
- source: hosted
- version: "2.0.0"
+ version: "1.7.0"
path:
dependency: transitive
description:
@@ -185,19 +190,26 @@ packages:
name: pointycastle
url: "https://pub.dartlang.org"
source: hosted
- version: "2.0.1"
+ version: "3.2.0"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
+ sodium_web:
+ dependency: transitive
+ description:
+ name: sodium_web
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.0.2"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
- version: "1.8.0"
+ version: "1.8.1"
stack_trace:
dependency: transitive
description:
@@ -232,7 +244,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
- version: "0.2.19"
+ version: "0.4.2"
tezster_dart:
dependency: "direct main"
description:
@@ -253,7 +265,7 @@ packages:
name: unorm_dart
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.2"
+ version: "0.2.0"
vector_math:
dependency: transitive
description:
@@ -262,5 +274,5 @@ packages:
source: hosted
version: "2.1.0"
sdks:
- dart: ">=2.12.0-0.0 <3.0.0"
- flutter: ">=1.10.0"
+ dart: ">=2.12.0 <3.0.0"
+ flutter: ">=1.20.0"
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index a77bc68..f577ad8 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
- sdk: ">=2.7.0 <3.0.0"
+ sdk: '>=2.12.0 <3.0.0'
dependencies:
flutter:
diff --git a/lib/chain/tezos/tezos_language_util.dart b/lib/chain/tezos/tezos_language_util.dart
index ccda09f..1947fc7 100644
--- a/lib/chain/tezos/tezos_language_util.dart
+++ b/lib/chain/tezos/tezos_language_util.dart
@@ -2,12 +2,12 @@
import 'package:tezster_dart/michelson_parser/michelson_parser.dart';
class TezosLanguageUtil {
- static String translateMichelsonToMicheline(String code) {
+ static String? translateMichelsonToMicheline(String code) {
var result = MichelsonParser.parseMichelson(code);
return result;
}
- static String translateMichelineToHex(p) {
+ static String? translateMichelineToHex(p) {
return MichelsonParser.translateMichelineToHex(p);
}
}
diff --git a/lib/chain/tezos/tezos_message_codec.dart b/lib/chain/tezos/tezos_message_codec.dart
index 48fbbc4..c9478ef 100644
--- a/lib/chain/tezos/tezos_message_codec.dart
+++ b/lib/chain/tezos/tezos_message_codec.dart
@@ -24,15 +24,15 @@ class TezosMessageCodec {
static String encodeTransaction(OperationModel message) {
String hex = TezosMessageUtils.writeInt(108);
- hex += TezosMessageUtils.writeAddress(message.source).substring(2);
- hex += TezosMessageUtils.writeInt(int.parse(message.fee));
- hex += TezosMessageUtils.writeInt(message.counter);
- hex += TezosMessageUtils.writeInt(message.gasLimit);
+ hex += TezosMessageUtils.writeAddress(message.source!).substring(2);
+ hex += TezosMessageUtils.writeInt(int.parse(message.fee!));
+ hex += TezosMessageUtils.writeInt(message.counter!);
+ hex += TezosMessageUtils.writeInt(message.gasLimit!);
hex += TezosMessageUtils.writeInt(message.storageLimit);
- hex += TezosMessageUtils.writeInt(int.parse(message.amount));
- hex += TezosMessageUtils.writeAddress(message.destination);
+ hex += TezosMessageUtils.writeInt(int.parse(message.amount!));
+ hex += TezosMessageUtils.writeAddress(message.destination!);
if (message.parameters != null) {
- var composite = message.parameters;
+ var composite = message.parameters!;
var result = TezosLanguageUtil.translateMichelineToHex(
jsonEncode(composite['value']));
if ((composite['entrypoint'] == 'default' ||
@@ -61,7 +61,7 @@ class TezosMessageCodec {
.map((String c) => c.codeUnitAt(0).toRadixString(16))
.join('');
}
- var resRad = '0000000' + (result.length ~/ 2).toRadixString(16);
+ var resRad = '0000000' + (result!.length ~/ 2).toRadixString(16);
hex += resRad.substring(resRad.length - 8) + result;
}
} else {
@@ -72,25 +72,25 @@ class TezosMessageCodec {
static String encodeReveal(OperationModel message) {
var hex = TezosMessageUtils.writeInt(107);
- hex += TezosMessageUtils.writeAddress(message.source).substring(2);
- hex += TezosMessageUtils.writeInt(int.parse(message.fee));
- hex += TezosMessageUtils.writeInt(message.counter);
- hex += TezosMessageUtils.writeInt(message.gasLimit);
+ hex += TezosMessageUtils.writeAddress(message.source!).substring(2);
+ hex += TezosMessageUtils.writeInt(int.parse(message.fee!));
+ hex += TezosMessageUtils.writeInt(message.counter!);
+ hex += TezosMessageUtils.writeInt(message.gasLimit!);
hex += TezosMessageUtils.writeInt(message.storageLimit);
- hex += TezosMessageUtils.writePublicKey(message.publicKey);
+ hex += TezosMessageUtils.writePublicKey(message.publicKey!);
return hex;
}
static String encodeDelegation(OperationModel delegation) {
var hex = TezosMessageUtils.writeInt(110);
- hex += TezosMessageUtils.writeAddress(delegation.source).substring(2);
- hex += TezosMessageUtils.writeInt(int.parse(delegation.fee));
- hex += TezosMessageUtils.writeInt(delegation.counter);
- hex += TezosMessageUtils.writeInt(delegation.gasLimit);
+ hex += TezosMessageUtils.writeAddress(delegation.source!).substring(2);
+ hex += TezosMessageUtils.writeInt(int.parse(delegation.fee!));
+ hex += TezosMessageUtils.writeInt(delegation.counter!);
+ hex += TezosMessageUtils.writeInt(delegation.gasLimit!);
hex += TezosMessageUtils.writeInt(delegation.storageLimit);
- if (delegation.delegate != null && delegation.delegate.isNotEmpty) {
+ if (delegation.delegate != null && delegation.delegate!.isNotEmpty) {
hex += TezosMessageUtils.writeBoolean(true);
- hex += TezosMessageUtils.writeAddress(delegation.delegate).substring(2);
+ hex += TezosMessageUtils.writeAddress(delegation.delegate!).substring(2);
} else {
hex += TezosMessageUtils.writeBoolean(false);
}
@@ -99,28 +99,28 @@ class TezosMessageCodec {
static String encodeOrigination(OperationModel origination) {
var hex = TezosMessageUtils.writeInt(109);
- hex += TezosMessageUtils.writeAddress(origination.source).substring(2);
- hex += TezosMessageUtils.writeInt(int.parse(origination.fee));
- hex += TezosMessageUtils.writeInt(origination.counter);
- hex += TezosMessageUtils.writeInt(origination.gasLimit);
+ hex += TezosMessageUtils.writeAddress(origination.source!).substring(2);
+ hex += TezosMessageUtils.writeInt(int.parse(origination.fee!));
+ hex += TezosMessageUtils.writeInt(origination.counter!);
+ hex += TezosMessageUtils.writeInt(origination.gasLimit!);
hex += TezosMessageUtils.writeInt(origination.storageLimit);
- hex += TezosMessageUtils.writeInt(int.parse(origination.amount));
+ hex += TezosMessageUtils.writeInt(int.parse(origination.amount!));
if (origination.delegate != null) {
hex += TezosMessageUtils.writeBoolean(true);
- hex += TezosMessageUtils.writeAddress(origination.delegate).substring(2);
+ hex += TezosMessageUtils.writeAddress(origination.delegate!).substring(2);
} else {
hex += TezosMessageUtils.writeBoolean(false);
}
if (origination.script != null) {
var parts = [];
- parts.add(origination.script['code']);
- parts.add(origination.script['storage']);
+ parts.add(origination.script!['code']);
+ parts.add(origination.script!['storage']);
hex += parts
.map((p) => jsonEncode(p))
.map((p) => TezosLanguageUtil.translateMichelineToHex(p))
.fold('', (m, p) {
- var result = ('0000000' + (p.length ~/ 2).toRadixString(16));
+ var result = ('0000000' + (p!.length ~/ 2).toRadixString(16));
result = result.substring(result.length - 8) + p;
return m + result;
});
diff --git a/lib/chain/tezos/tezos_message_utils.dart b/lib/chain/tezos/tezos_message_utils.dart
index 4a4ca3f..ac6dfcf 100644
--- a/lib/chain/tezos/tezos_message_utils.dart
+++ b/lib/chain/tezos/tezos_message_utils.dart
@@ -188,7 +188,7 @@ class TezosMessageUtils {
.join('');
}
- static String writeString(value) {
+ static String? writeString(value) {
var len = dataLength(value.length);
var text = value
.split('')
@@ -247,7 +247,7 @@ class TezosMessageUtils {
case 'nat':
return '0500' + writeInt(int.parse(value));
case 'string':
- return '0501' + writeString(value);
+ return '0501' + writeString(value)!;
case 'key_hash':
var address = writeAddress(value).substring(2);
return '050a${dataLength(address.length / 2)}$address';
@@ -263,7 +263,7 @@ class TezosMessageUtils {
return '05${TezosLanguageUtil.translateMichelineToHex(value)}';
} else if (format == TezosParameterFormat.Michelson) {
var micheline =
- TezosLanguageUtil.translateMichelsonToMicheline(value);
+ TezosLanguageUtil.translateMichelsonToMicheline(value)!;
return '05${TezosLanguageUtil.translateMichelineToHex(micheline)}';
} else {
throw new Exception('Unsupported format $format provided');
diff --git a/lib/chain/tezos/tezos_node_reader.dart b/lib/chain/tezos/tezos_node_reader.dart
index 3e630a2..1e638f8 100644
--- a/lib/chain/tezos/tezos_node_reader.dart
+++ b/lib/chain/tezos/tezos_node_reader.dart
@@ -1,4 +1,6 @@
import 'package:tezster_dart/helper/http_helper.dart';
+import 'package:tezster_dart/michelson_parser/michelson_parser.dart';
+import 'package:tezster_dart/michelson_parser/parser/michelson_grammar.dart';
class TezosNodeReader {
static Future getCounterForAccount(String server, String publicKeyHash,
@@ -23,34 +25,48 @@ class TezosNodeReader {
return response != null ? response.toString() : '';
}
- static Future