Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigInt support & WalletConnect implementation #19

Merged
merged 168 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
7e1da6c
Feat: Add deep linking - syrius://
Jan 28, 2023
407efea
Update main_app_container.dart
alienc0der Feb 3, 2023
994c7d6
Merge branch 'cicd' into wallet-connect
alienc0der Feb 10, 2023
adb0bf3
Merge pull request #23 from mik3mast3rs/wallet-connect
alienc0der Feb 10, 2023
1393081
fix: MacOS deep link support
alienc0der Feb 11, 2023
d013dd0
Merge pull request #31 from alienc0der/cicd
alienc0der Feb 11, 2023
dccf1ad
Feat: Add UI for Wallet Connect
Feb 17, 2023
66d3615
feat: Enable pairing with dApps through WC
Feb 18, 2023
9d76a62
chore: Add namespaces and more listeners
Feb 19, 2023
aec25d6
Replace bodyText1 with bodyLarge
alienc0der Mar 4, 2023
b4666a0
fix: Change WC initialization
Apr 5, 2023
77145ef
chore: Update gitignore
Apr 5, 2023
4dc4c3f
chore: Update repo after gitignore update
Apr 5, 2023
ce32bd4
feat: Add method that activates the pairing
Apr 8, 2023
606677d
feat: Add feature that captures a part of the screen and listens to t…
Apr 8, 2023
859c264
feat: Build table that shows the current pairings
Apr 8, 2023
500293b
feat: Add feature to scan the QR code from the screen
Apr 9, 2023
b069e52
fix: Remove Expanded widget from Pairings card widget tree
Apr 9, 2023
c8cfec9
feat: Listens to values in the clipboard in order to check for WC URI
Apr 9, 2023
2c1a33c
fix: Make access check for MacOS before scanning screen
Apr 9, 2023
ad0a818
feat: Redirect to WC tab when a WC URI is detected
Apr 9, 2023
5e9e050
fix: Rebuild WC URI input field when another URI is detected in the c…
Apr 9, 2023
ad4a41b
Updated native libraries
Apr 10, 2023
7075f39
fix: Recreate the windows folder
Apr 10, 2023
734ecb2
feat: Add code that opens the app through deep linking
Apr 10, 2023
7d01524
refactor: Change API call when activating a pairing
Apr 10, 2023
a69ebe1
feat: Add possibility to deactivate a WC pair
Apr 10, 2023
002ec92
feat: Redirect to WC tab when opening the wallet through WC deep linking
Apr 11, 2023
13479fd
fix: Error initializing the WC uri input field
Apr 12, 2023
b7d5f00
feat: Improve validating the WC URI
Apr 12, 2023
657ba1a
feat: Add handler for znn_net_info WC method
Apr 14, 2023
9576cd7
feat: Add handler for znn_sign WC method
Apr 14, 2023
fe514b9
refactor: Create function for signing with the key pair from the wall…
Apr 14, 2023
69de6ad
feat: Add handler for WC znn_send method
Apr 14, 2023
edc18a1
feat: Change name of znn_net_info method to znn_info and refactor sen…
Apr 15, 2023
0226cb3
fix: Restyle the Topic column from the WC pairings table
Apr 15, 2023
3c19221
feat: Send back an account block to the dApp after executing the znn_…
Apr 15, 2023
869810d
feat: Send events to the dApp when the address or chain id were changed
Apr 15, 2023
8d4ed12
feat: Send error to the dApp when user rejects the transfer
Apr 15, 2023
440db85
fix: Change the error type send to the dApp
Apr 15, 2023
a0f02ba
feat: Add confirmation dialogs before making an action sent from the …
Apr 15, 2023
4b31538
refactor
Apr 15, 2023
8d58df2
feat: Fix dialog when dApp wants to send a tx
Apr 15, 2023
c74f49a
fix: Reset the URI value from the change notifier once it's used
Apr 16, 2023
4197c53
fix: Don't redirect to WC when detecting a WC URI if the wallet is lo…
Apr 17, 2023
18c04d1
fix: Show WC URI detected notification if the user is already on the …
Apr 17, 2023
6edc234
feat: Throw an error when trying to trigger an action through WC and …
Apr 17, 2023
5daa318
feat: Reconnect to websocket when WC connection falls
Apr 17, 2023
2fe7c75
feat: Add methods to retrieve the active sessions and all sessions
Apr 19, 2023
b530f6e
feat: Get the reference for getting the ZNN SDK
Apr 19, 2023
5b4ed1d
feat: Change position of the WC Connect button and disable it in case…
Apr 19, 2023
e61fa56
refactor: Delete unused method
Apr 19, 2023
c1264bd
feat: Send notification when user cancels the QR scanning
Apr 19, 2023
01f2b8d
feat: Keep the WC URI in memory when wallet is locked
Apr 19, 2023
ac82bc0
feat: Update WalletConnectPairingCard with the needed permissions
Apr 20, 2023
7626f82
feat: Update files
Apr 20, 2023
f510bd7
feat: Wrap up WC
Apr 20, 2023
5fac595
fix: Clean up
Apr 20, 2023
c3217a8
feat: Get WC project id from environment variable
Apr 21, 2023
39f1a31
Merge pull request #32 from alienc0der/release-v0.0.6
alienc0der Apr 21, 2023
50840e3
Merge branch 'zenon-network:master' into master
alienc0der Apr 21, 2023
d0763b3
Merge pull request #33 from alienc0der/dev
alienc0der Apr 21, 2023
4dfdd19
fix: Rebuild 'Connect' button when the URI input field is also rebuild
Apr 21, 2023
3d4e4b5
Merge branch 'wallet-connect-alienc0der' into wallet-connect
Apr 21, 2023
96a6871
feat: Rebuild pubspec.lock
Apr 21, 2023
2064921
feat: Change the source of the ZNN SDK
Apr 21, 2023
1c32cae
Merge pull request #34 from mik3mast3rs/wallet-connect
alienc0der Apr 21, 2023
1250f3a
build: referenced wallet-connect sdk branch
alienc0der Apr 23, 2023
0b65711
build: added required macos entitlements
alienc0der Apr 23, 2023
9e5337c
refactor: small refactor
alienc0der Apr 23, 2023
d1f804c
docs: updated README
alienc0der Apr 23, 2023
4824a33
cicd: retrieve WALLET_CONNECT_PROJECT_ID
alienc0der Apr 24, 2023
e036805
cicd: added environment name
alienc0der Apr 24, 2023
65c1b9a
cicd: updated flutter-action
alienc0der Apr 24, 2023
32b8aeb
cicd: set linux directory permissions
alienc0der Apr 24, 2023
d88c742
feat: added BigInt support
alienc0der May 7, 2023
1104129
fix: referenced latest SDK changes
alienc0der May 7, 2023
c1425a2
fix: desktop window
alienc0der May 7, 2023
e4ad9b6
fix: windows desktop window
alienc0der May 7, 2023
ff4c214
fix: bigInt decimal conversions
alienc0der May 8, 2023
54cc76f
chore: updated dependencies
alienc0der May 9, 2023
2d5907d
fix: tokenSymbol widget
alienc0der May 10, 2023
78517b1
fix: minor UI fixes
alienc0der May 10, 2023
583d975
cicd: hardcoded flutter version for compatibility
alienc0der May 11, 2023
769d7d2
feat: Change caching the active sessions for a pairing
May 11, 2023
d7ace43
Merge pull request #35 from mik3mast3rs/bigint-support-alienc0der
alienc0der May 11, 2023
b54a8d1
fix: allow any ZTS in znn_send
alienc0der May 12, 2023
22c1708
feat: added WalletConnect events
alienc0der May 12, 2023
17f8eb4
fix: remove relayClient reconnect
alienc0der May 12, 2023
49dd860
feat: Add widget for pairing session data
May 13, 2023
b6e03e9
feat: Tweak WC pairing flow
May 14, 2023
9368ac4
fix: Emit the session event (address and chain id events) to each dAp…
May 14, 2023
7f3f358
Merge pull request #36 from mik3mast3rs/bigint-support-alienc0der
alienc0der May 15, 2023
8b30194
fix: add windows directory
alienc0der May 15, 2023
775c112
chore: update walletconnect_flutter_v2 to v2.0.4
alienc0der May 16, 2023
f60bff7
fix: BigInt fixes
alienc0der May 18, 2023
8624cbf
feat: Regenerate windows folder
May 19, 2023
5e89341
Merge branch 'bigint-support' into bigint-support-alienc0der
May 19, 2023
fc7f96c
feat: Regenerate windows folder
May 21, 2023
e18f9aa
feat: Refresh WC URI input field after pairing
May 21, 2023
ae89659
feat: error notification for auto-receive
alienc0der May 21, 2023
fdb7714
chore: updated walletconnect_flutter_v2 to v2.0.6
alienc0der May 21, 2023
780db94
feat: Build WC uri card
May 21, 2023
2ad3b96
feat: Build WC QR card
May 21, 2023
7261812
feat: Build WC camera card
May 21, 2023
eb233fc
feat: Put the pairings and sessions widgets side by side
May 21, 2023
52c6de9
feat: Change button name
May 21, 2023
f26f2f5
Merge branch 'bigint-support' into bigint-support-alienc0der
May 22, 2023
848879a
Merge pull request #37 from mik3mast3rs/bigint-support-alienc0der
alienc0der May 22, 2023
fb1c838
fix: flutter windows directory
alienc0der May 23, 2023
f29ba45
chore: update uni_links_desktop to v0.1.6
alienc0der May 23, 2023
9523ba8
fix: windows deep link handling
alienc0der May 23, 2023
5fd75c2
feat: added notification for incoming links
alienc0der May 23, 2023
32ac3a6
feat: Refresh pairing and session lists when connecting to dApp
May 23, 2023
98a7a63
feat: Align pairing and session list widgets on top of each other
May 23, 2023
4ddccaa
refactor: Add the getter pairings to the WalletConnectService class
May 23, 2023
2e83238
feat: replaced uni_links with app_links
alienc0der May 23, 2023
cf2df64
fix: Revert changes to the pairing list widget
May 23, 2023
d5c52e8
fix: Make InfiniteScrollBloc handle case when the data request is not…
May 23, 2023
e3879a0
fix: Don't dispose the pairings and sessions bloc
May 23, 2023
a3cddd9
Merge branch 'bigint-support' into bigint-support-alienc0der
May 23, 2023
23acff1
fix: Also refresh sessions list after deleting a pairing
May 23, 2023
037300e
fix: Check for broken WC URI
May 23, 2023
e3193da
Merge pull request #38 from mik3mast3rs/bigint-support-alienc0der
alienc0der May 24, 2023
86b5a32
fix: added refresh for onPairingCreate
alienc0der May 24, 2023
958e96b
fix: Redirect to WC tab when an WC URI is detected while the wallet i…
May 29, 2023
61c67e7
fix: Don't cache results for blocs that don't handle paginated results
May 29, 2023
3fb1377
Merge branch 'bigint-support' into bigint-support-alienc0der
May 29, 2023
c0a5757
Merge pull request #39 from mik3mast3rs/bigint-support-alienc0der
alienc0der May 30, 2023
9ab28dd
fix: Decode WC URI before parsing
Jun 1, 2023
b48b6bf
Merge pull request #40 from mik3mast3rs/bigint-support-alienc0der
alienc0der Jun 2, 2023
27f792a
feat: Upgrade project to Dart 3.0.1
Jun 2, 2023
edbf5d6
feat: Delete button that disconnects the WC session with the dApp
Jun 2, 2023
a484bf4
feat: Throw error if trying to send tx from dApp while wallet is locked
Jun 2, 2023
e4d7a18
Merge pull request #41 from mik3mast3rs/bigint-support-alienc0der
alienc0der Jun 2, 2023
9669a8f
cicd: upgraded flutter to v3.10.2
alienc0der Jun 2, 2023
6b2fa30
chore: update texts
alienc0der Jun 2, 2023
3a91f09
feat: Update WC dependency to 2.0.8
Jun 4, 2023
b7eaf47
Merge pull request #42 from mik3mast3rs/bigint-support-alienc0der
alienc0der Jun 6, 2023
4644fad
fix: parse WalletConnect URI
alienc0der Jun 6, 2023
b4d03ba
fix: Dart lint warnings
alienc0der Jun 6, 2023
f0d99df
feat: bump version to v0.0.7
alienc0der Jun 6, 2023
aa92c7c
fix: Windows deep link
alienc0der Jun 7, 2023
85b968d
Updated native libraries
Jun 7, 2023
a19eae5
feat: Hard code chainId to 1 for WC
Jun 7, 2023
7ea2312
Merge pull request #43 from mik3mast3rs/bigint-support-alienc0der
alienc0der Jun 7, 2023
80e421a
fix: WalletConnect improvements
alienc0der Jun 12, 2023
0de40ae
fix: When to mark last page of the infinite scroll bloc
Jun 13, 2023
e7b5ffc
Merge pull request #44 from mik3mast3rs/bigint-support-alienc0der
alienc0der Jun 13, 2023
99e94d5
fix: dialog navigator pop
alienc0der Jun 15, 2023
abd1e0f
fix: added marquee for token balance
alienc0der Jun 15, 2023
8166496
feat: logging to disk
alienc0der Jun 20, 2023
9ebcae8
refactor: renamed votePillar to delegateToPillar
alienc0der Jun 20, 2023
3749c49
fix: WalletConnect issues
alienc0der Jun 21, 2023
a40427c
feat: programmatically display WalletConnect tab
alienc0der Jun 21, 2023
173dac2
feat: added deep link actions
alienc0der Jun 22, 2023
47fb582
feat: update defaultValue for kWcProjectId
alienc0der Jun 28, 2023
6fdeec0
chore: updated walletconnect_flutter_v2 to v2.0.12
alienc0der Jul 11, 2023
8e9df2d
chore: update dependencies
alienc0der Jul 12, 2023
18f05d3
feat: added camera QR scanning for MacOS
alienc0der Jul 13, 2023
65799c7
fix: WakelockPlus Linux support
alienc0der Jul 19, 2023
b8c1fc3
fix: replaced logger with Logger
alienc0der Jul 19, 2023
ac2b5e0
chore: added descriptions and code cleanup
alienc0der Jul 19, 2023
98aea81
fix: wallet_connect_tab_child import
alienc0der Jul 19, 2023
006bd7b
fix: minimum amount to send
alienc0der Jul 19, 2023
fbf7fe5
fix: refresh WalletConnectSessionsBloc
alienc0der Jul 19, 2023
0ae4858
fix: remainingZnnBudget decimals
alienc0der Jul 20, 2023
cbac36f
fix: onSessionDelete refresh
alienc0der Jul 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/syrius_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:

jobs:
build-macos:
environment: wallet-connect
env:
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WC_PROJECT_ID }}
runs-on: macos-12
steps:
- name: Checkout
Expand All @@ -23,15 +26,16 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
uses: subosito/flutter-action@v2.10.0
with:
channel: "stable"
flutter-version: "3.10.2"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-macos-desktop
flutter build macos --release
flutter build macos --dart-define=WC_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID --release
- name: Package into DMG
run: |
create-dmg --volname syrius \
Expand All @@ -53,20 +57,24 @@ jobs:
name: macos-artifacts
path: syrius-alphanet-macos-universal.dmg
build-windows:
environment: wallet-connect
env:
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WC_PROJECT_ID }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
uses: subosito/flutter-action@v2.10.0
with:
channel: "stable"
flutter-version: "3.10.2"
- name: Check flutter version
run: flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-windows-desktop
flutter build windows --release
flutter build windows --dart-define=WC_PROJECT_ID=$env:WALLET_CONNECT_PROJECT_ID --release
- name: Package into zip
run: |
Compress-Archive -Path build\windows\runner\Release\* -DestinationPath .\syrius-alphanet-windows-amd64.zip
Expand All @@ -76,6 +84,9 @@ jobs:
name: windows-artifacts
path: syrius-alphanet-windows-amd64.zip
build-linux:
environment: wallet-connect
env:
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WC_PROJECT_ID }}
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand All @@ -85,15 +96,21 @@ jobs:
sudo apt update
sudo apt install -y curl clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev unzip xz-utils zip libnotify-dev libayatana-appindicator3-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
uses: subosito/flutter-action@v2.10.0
with:
channel: "stable"
flutter-version: "3.10.2"
- name: Set permissions
run: |
sudo chmod -R 777 linux/
- name: Check flutter version
run: flutter --version
run: |
which flutter
flutter --version
- name: Build syrius desktop
run: |
flutter config --enable-linux-desktop
flutter build linux --release
flutter build linux --dart-define=WC_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID --release -v
- name: Package zip
run: |
cd build/linux/x64/release/bundle
Expand Down
69 changes: 14 additions & 55 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.classpath
.project
.settings/
.vscode/
.vscode/*

# Flutter repo-specific
/bin/cache/
Expand Down Expand Up @@ -51,17 +51,14 @@ analysis_benchmark.json
.flutter-plugins-dependencies
**/generated_plugin_registrant.dart
.packages
.pub-cache/
.pub-preload-cache/
.pub/
build/
flutter_*.png
linked_*.ds
unlinked.ds
unlinked_spec.ds

# Web related
lib/generated_plugin_registrant.dart

# Android related
**/android/**/gradle-wrapper.jar
.gradle/
Expand Down Expand Up @@ -104,71 +101,33 @@ lib/generated_plugin_registrant.dart
**/ios/Runner/GeneratedPluginRegistrant.*

# macOS
**/Flutter/ephemeral/
**/Pods/
**/macos/Flutter/GeneratedPluginRegistrant.swift
**/macos/Flutter/ephemeral
**/xcuserdata/

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Windows
**/windows/flutter/generated_plugin_registrant.cc
**/windows/flutter/generated_plugin_registrant.h
**/windows/flutter/generated_plugins.cmake

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk
# Linux
**/linux/flutter/generated_plugin_registrant.cc
**/linux/flutter/generated_plugin_registrant.h
**/linux/flutter/generated_plugins.cmake

# Coverage
coverage/

# Symbols
app.*.symbols

# Obfuscation related
app.*.map.json

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
!/dev/ci/**/Gemfile.lock
!pubspec.lock
!.vscode/settings.json
30 changes: 30 additions & 0 deletions .metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled.

version:
revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
- platform: windows
create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf
base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,19 @@ Dependencies:

Currently supported `<os>`: `windows`, `macos`, `linux`

The [WalletConnect](https://github.com/WalletConnect) integration requires setting the `WC_PROJECT_ID` environmental variable.

```bash
git clone https://github.com/zenon-network/syrius.git
flutter pub get
flutter build <os>
flutter build <os> --release
flutter run --release
flutter run --dart-define=WC_PROJECT_ID=walletconnect_project_id -d <os>
flutter build --dart-define=WC_PROJECT_ID=walletconnect_project_id <os>
```

## Contributing

Please check CONTRIBUTING for more details.
Please check [CONTRIBUTING](./CONTRIBUTING.md) for more details.

## License

The MIT License (MIT). Please check LICENSE for more information.
The MIT License (MIT). Please check [LICENSE](./LICENSE) for more information.
12 changes: 12 additions & 0 deletions assets/svg/walletconnect-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion lib/blocs/accelerator/accelerator_balance_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class AcceleratorBalanceBloc extends BaseBloc<AccountInfo?> {
AccountInfo accountInfo = await zenon!.ledger.getAccountInfoByAddress(
acceleratorAddress,
);
if (accountInfo.qsr()! > 0 || accountInfo.znn()! > 0) {
if (accountInfo.qsr()! > BigInt.zero ||
accountInfo.znn()! > BigInt.zero) {
addEvent(accountInfo);
} else {
throw 'Accelerator fund empty';
Expand Down
4 changes: 2 additions & 2 deletions lib/blocs/accelerator/create_phase_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class CreatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
String name,
String description,
String url,
int znnFundsNeeded,
int qsrFundsNeeded,
BigInt znnFundsNeeded,
BigInt qsrFundsNeeded,
) async {
try {
addEvent(null);
Expand Down
6 changes: 3 additions & 3 deletions lib/blocs/accelerator/create_project_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
String name,
String description,
String url,
int znnFundsNeeded,
int qsrFundsNeeded,
BigInt znnFundsNeeded,
BigInt qsrFundsNeeded,
) {
try {
addEvent(null);
Expand All @@ -26,7 +26,7 @@ class CreateProjectBloc extends BaseBloc<AccountBlockTemplate?> {
'creating project',
).then(
(block) {
AddressUtils.refreshBalance();
ZenonAddressUtils.refreshBalance();
addEvent(block);
},
).onError(
Expand Down
11 changes: 5 additions & 6 deletions lib/blocs/accelerator/submit_donation_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/utils/account_block_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/extensions.dart';
import 'package:zenon_syrius_wallet_flutter/utils/zts_utils.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

class SubmitDonationBloc extends BaseBloc<AccountBlockTemplate?> {
Future<void> submitDonation(num znnAmount, num qsrAmount) async {
Future<void> submitDonation(BigInt znnAmount, BigInt qsrAmount) async {
try {
addEvent(null);
if (znnAmount > 0) {
if (znnAmount > BigInt.zero) {
await _sendDonationBlock(zenon!.embedded.accelerator.donate(
znnAmount.extractDecimals(znnDecimals),
znnAmount,
kZnnCoin.tokenStandard,
));
}
if (qsrAmount > 0) {
if (qsrAmount > BigInt.zero) {
await _sendDonationBlock(zenon!.embedded.accelerator.donate(
qsrAmount.extractDecimals(qsrDecimals),
qsrAmount,
kQsrCoin.tokenStandard,
));
}
Expand Down
14 changes: 4 additions & 10 deletions lib/blocs/accelerator/update_phase_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:zenon_syrius_wallet_flutter/blocs/blocs.dart';
import 'package:zenon_syrius_wallet_flutter/main.dart';
import 'package:zenon_syrius_wallet_flutter/utils/account_block_utils.dart';
import 'package:zenon_syrius_wallet_flutter/utils/utils.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

class UpdatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
void updatePhase(Hash id, String name, String description, String url,
double znnFundsNeeded, double qsrFundsNeeded) {
BigInt znnFundsNeeded, BigInt qsrFundsNeeded) {
try {
addEvent(null);
AccountBlockTemplate transactionParams =
Expand All @@ -14,14 +14,8 @@ class UpdatePhaseBloc extends BaseBloc<AccountBlockTemplate?> {
name,
description,
url,
AmountUtils.extractDecimals(
znnFundsNeeded,
znnDecimals,
),
AmountUtils.extractDecimals(
qsrFundsNeeded,
qsrDecimals,
),
znnFundsNeeded,
qsrFundsNeeded,
);
AccountBlockUtils.createAccountBlock(transactionParams, 'update phase')
.then(
Expand Down
4 changes: 3 additions & 1 deletion lib/blocs/auto_receive_tx_worker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
);
_sendSuccessNotification(response, toAddress);
} on RpcException catch (e, stackTrace) {
_sendErrorNotification(e.toString());
Logger('AutoReceiveTxWorker')
.log(Level.WARNING, 'autoReceive', e, stackTrace);
if (e.message.compareTo('account-block from-block already received') !=
Expand Down Expand Up @@ -74,7 +75,8 @@ class AutoReceiveTxWorker extends BaseBloc<WalletNotification> {
void _sendSuccessNotification(AccountBlockTemplate block, String toAddress) {
addEvent(
WalletNotification(
title: 'Transaction received on ${AddressUtils.getLabel(toAddress)}',
title:
'Transaction received on ${ZenonAddressUtils.getLabel(toAddress)}',
timestamp: DateTime.now().millisecondsSinceEpoch,
details: 'Transaction hash: ${block.hash}',
type: NotificationType.paymentReceived,
Expand Down
Loading