Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
e73328e
Starter for ChainX Plugin
true-eye Feb 8, 2021
cb8879e
ChainX Node List updated
true-eye Feb 8, 2021
e1087e8
Update ChainX gray icon
true-eye Feb 8, 2021
7d85964
ChainX color theme added
true-eye Feb 8, 2021
e5bbdf0
PCX token added for ChainX
true-eye Feb 8, 2021
81a9db7
added PCX.png to pubspec.yaml
true-eye Feb 15, 2021
a625bbc
update ChainX node list
true-eye Feb 15, 2021
04f64df
update Elena Node endpoint
true-eye Feb 17, 2021
b1e0e5a
added js_service_chainx
true-eye Feb 18, 2021
b3402f5
ss58 0
true-eye Feb 18, 2021
d4b4da7
js_service_chainx asset
true-eye Feb 18, 2021
c494539
fix rootboundle undefined
true-eye Feb 18, 2021
6086eb7
comment staking and governance page
true-eye Feb 18, 2021
7e8ecaa
comment staking and governance
true-eye Feb 18, 2021
e794630
print data
true-eye Feb 18, 2021
0433bfd
no message
true-eye Feb 18, 2021
77bfda0
updated js_service_chainx wallet connection issue fixed
true-eye Feb 22, 2021
083e640
ChainxJS Wrapper.
true-eye Feb 22, 2021
f54c5b9
chainx genesishHash added
true-eye Feb 22, 2021
05bbfc2
test dist
true-eye Feb 22, 2021
deb9e11
test dist 2
true-eye Feb 22, 2021
d6314b2
update export
true-eye Feb 22, 2021
375ce60
js_service_chainx test
true-eye Feb 22, 2021
1873001
js_service_chainx update
true-eye Feb 22, 2021
de7786f
update account in js_service_chainx
true-eye Feb 22, 2021
e64477a
walletconnect added
true-eye Feb 22, 2021
b889c35
remove laminar libs
true-eye Feb 22, 2021
ca29482
comment staking module
true-eye Feb 22, 2021
95bde2c
connection return value string
true-eye Feb 22, 2021
72b400d
Merge pull request #1 from true-eye/connect_issue
true-eye Feb 22, 2021
df304e4
Added governance nav
true-eye Feb 22, 2021
9863993
added governance_yellow icon
true-eye Feb 22, 2021
c13326e
governance page routes available
true-eye Feb 22, 2021
dd34f52
debug networkState
true-eye Feb 22, 2021
9332c87
print networkState
true-eye Feb 22, 2021
7e716b2
use variable
true-eye Feb 22, 2021
f8d09a6
debug tokenDecimals
true-eye Feb 22, 2021
fff355e
print tokenDecimals
true-eye Feb 22, 2021
109f926
tokenSymbol, tokenDecimals single
true-eye Feb 23, 2021
c1afe76
proposal.index int
true-eye Feb 23, 2021
601007a
update governance yellow icon
true-eye Feb 23, 2021
660c70f
[governance] democracy page overflow issue
true-eye Feb 24, 2021
4895a77
[governance] topTabs component customized for overflow issue
true-eye Feb 24, 2021
914c92a
[governance] move to component folder
true-eye Feb 24, 2021
13b8da6
width decrease
true-eye Feb 24, 2021
ec06eca
width 150
true-eye Feb 24, 2021
194515f
font decrease
true-eye Feb 24, 2021
1ffdb09
font decrease
true-eye Feb 24, 2021
0e059e5
font decrease
true-eye Feb 24, 2021
ee2089e
font decrease
true-eye Feb 24, 2021
0810dfd
Manual font
true-eye Feb 24, 2021
9120bef
font decrease
true-eye Feb 24, 2021
4077754
TopTabs in local component
true-eye Feb 24, 2021
87aba23
int to string for elections
true-eye Feb 24, 2021
f66bd95
int string issue fixed
true-eye Feb 24, 2021
fcb2e08
proposals type match
true-eye Feb 24, 2021
7a9cdfc
tipDetailPage issue fixed
true-eye Feb 24, 2021
6f4cb6a
null tostring error
true-eye Feb 24, 2021
665296f
boolean expression must not be null
true-eye Feb 25, 2021
de3ee22
subscribeMessage for getBalance implemented
true-eye Feb 25, 2021
0e77c03
getBalance update
true-eye Feb 25, 2021
0fef829
update getbalance
true-eye Feb 25, 2021
d48e122
comment Polkassembly
true-eye Feb 25, 2021
8bfe990
staking page
true-eye Feb 25, 2021
1d60b2f
staking_yellow
true-eye Feb 25, 2021
0fb7802
staking tab
true-eye Feb 25, 2021
cc0b2f9
font size 16
true-eye Feb 25, 2021
fafdf73
staking yellow to pubspec
true-eye Feb 25, 2021
b56c385
change staking tab name, comment tx history in my staking page
true-eye Feb 25, 2021
d51571e
simplify actioncard
true-eye Feb 25, 2021
5ccd6b4
dummy ui for actioncard
true-eye Feb 25, 2021
401f602
dummy ui for actioncard
true-eye Feb 25, 2021
736eee4
block producer
true-eye Feb 25, 2021
3f610c6
blockproducer ui spaceevenly
true-eye Feb 25, 2021
39e8296
block producer start
true-eye Feb 25, 2021
a3f36c2
stakedinfo list added
true-eye Feb 25, 2021
3f775ea
3 column for stakedinfo
true-eye Feb 25, 2021
ada90a5
Simple UI text fix
true-eye Feb 25, 2021
7183c98
Alignment for stakedinfo
true-eye Feb 25, 2021
fcd6f93
Address icon added for stakedinfo
true-eye Feb 25, 2021
93c9439
My Stake Text added
true-eye Feb 25, 2021
89f6028
padding for stakedinfo text
true-eye Feb 25, 2021
839729c
style for mystakedinfo text
true-eye Feb 25, 2021
1be4d34
dummy validatorInfo
true-eye Feb 25, 2021
1e1148a
big int for total and own in dummy data
true-eye Feb 25, 2021
1ee95ac
dummy data for validatorinfo
true-eye Feb 25, 2021
46679ff
nominators list instead of map
true-eye Feb 25, 2021
8779e2a
elected validators as validatorsInfo
true-eye Feb 25, 2021
f03f1db
validatorsInfo to list
true-eye Feb 25, 2021
d33041c
comment recommended list
true-eye Feb 25, 2021
1da5a58
remove NomineeItem
true-eye Feb 25, 2021
8c17ee2
hide recommend
true-eye Feb 25, 2021
69e9eda
consider topcard
true-eye Feb 25, 2021
f6dd39f
searchbar as component
true-eye Feb 25, 2021
2801f8b
dummy validator 3
true-eye Feb 25, 2021
6ce4265
yellow version of staking icon updated
true-eye Feb 25, 2021
94c9d0a
ValidatorData type refine
true-eye Feb 26, 2021
0c87af4
flutter pub run build_runner build --delete-conflicting-outputs
true-eye Feb 26, 2021
13f344b
removed tablist in staking overview page (elected, waiting)
true-eye Feb 26, 2021
2d881e3
js_service_chain built again for querySortedTargets
true-eye Feb 26, 2021
8a55b0d
comment queryAccountBondedInfo
true-eye Feb 26, 2021
163f5d0
comment queryOwnStashInfo
true-eye Feb 26, 2021
ab9f5fe
queryElectedInfo
true-eye Feb 26, 2021
43835a1
ValidatorData Type registeredAt as int
true-eye Feb 26, 2021
84a1e20
lastTotalVoteWeightUpdate as int
true-eye Feb 26, 2021
1944add
rewardPotBalance as string
true-eye Feb 26, 2021
b39043f
parseInt string for rewardPotsBalance
true-eye Feb 26, 2021
7568b8c
accountId is missing
true-eye Feb 26, 2021
42d9b4e
My Staking, Top Translation added
true-eye Feb 26, 2021
0b16927
Elector updated
true-eye Feb 26, 2021
9df0c6f
Remove last block and added my votes
true-eye Feb 26, 2021
f50720e
top card ui
true-eye Feb 26, 2021
ea17cf3
uncomment staking cache
true-eye Feb 26, 2021
07168f2
My Stake listing
true-eye Feb 26, 2021
211d43f
js service build update
true-eye Feb 26, 2021
0cc2694
List.of to List.from
true-eye Feb 26, 2021
b42c769
from to fromJson
true-eye Feb 26, 2021
55ffb23
toList
true-eye Feb 26, 2021
25fa2a4
loading nominations
true-eye Feb 26, 2021
33202e5
Votes sum added
true-eye Feb 26, 2021
70f2239
My votes for vaildators page
true-eye Feb 27, 2021
8e4ad87
TopCard StatelessWidget Added
true-eye Feb 27, 2021
a08b8e4
3 tabs
true-eye Feb 28, 2021
da7f7f4
tab controller length 3
true-eye Feb 28, 2021
8fc4d29
tab labe font size 16
true-eye Feb 28, 2021
4300ce0
validator, candidate, drop out
true-eye Feb 28, 2021
1db80d5
whereiterator vs list
true-eye Feb 28, 2021
ac0439d
formatPCXBalance added to js
true-eye Feb 28, 2021
b8ab3ab
Fmt field introduced
true-eye Feb 28, 2021
d599543
fromJson method added
true-eye Feb 28, 2021
098421d
formatBalance updated
true-eye Feb 28, 2021
4d88d31
formatBalance updated
true-eye Feb 28, 2021
607ceee
update js_Service
true-eye Feb 28, 2021
5b6684b
Sort by list updated
true-eye Feb 28, 2021
f6fe624
translate fix
true-eye Feb 28, 2021
719a2b0
enum split
true-eye Feb 28, 2021
2265e44
validator detail page
true-eye Feb 28, 2021
0b1abd0
validator detail page, my stake loading page
true-eye Feb 28, 2021
8fccc12
topcard loading fix
true-eye Feb 28, 2021
51c700c
vote button added
true-eye Feb 28, 2021
a592ec8
Vote Page
true-eye Feb 28, 2021
7006a85
stakePage
true-eye Feb 28, 2021
67d3e2c
Vote Page update
true-eye Feb 28, 2021
ec19521
tr failed
true-eye Feb 28, 2021
d33f66a
validator keypair
true-eye Mar 1, 2021
3c578c4
stakepage fix
true-eye Mar 1, 2021
13e4cd2
accInfo
true-eye Mar 1, 2021
92d8e96
validatorAddressFormItem
true-eye Mar 1, 2021
3ef124a
UI.accountDisplayName
true-eye Mar 1, 2021
2f2511c
vote transaction
true-eye Mar 1, 2021
19a65ff
vote transaction
true-eye Mar 1, 2021
b549598
_bondParams
true-eye Mar 1, 2021
5afa5da
tr failed
true-eye Mar 1, 2021
1ae688a
empty interests
true-eye Mar 1, 2021
09e1216
json to list
true-eye Mar 1, 2021
0f23263
for empty nomination
true-eye Mar 1, 2021
2ebba28
null check for string
true-eye Mar 1, 2021
b68d28c
try with int
true-eye Mar 1, 2021
058228e
Big int
true-eye Mar 1, 2021
dc854db
big int
true-eye Mar 1, 2021
9dfa562
originally bigint
true-eye Mar 1, 2021
9ce4188
toList
true-eye Mar 1, 2021
2e1f6b7
bypass filter
true-eye Mar 1, 2021
c5b85d7
My Stake address
true-eye Mar 1, 2021
56db7b2
priceFloor
true-eye Mar 1, 2021
2f088e8
format price
true-eye Mar 1, 2021
7d4fca0
parseInt
true-eye Mar 1, 2021
89421b9
filterNomination fixed
true-eye Mar 1, 2021
bbbf69b
loading until global
true-eye Mar 1, 2021
51f1bd5
Expanded
true-eye Mar 1, 2021
b6a8e51
loading until global
true-eye Mar 1, 2021
068ef32
refresh mystake page
true-eye Mar 1, 2021
8e127a6
update automatically
true-eye Mar 1, 2021
70eb1c8
ss58 44 in service
true-eye Mar 1, 2021
c14e8c2
keyring initKeys
true-eye Mar 1, 2021
d3269f2
keyring 44
true-eye Mar 1, 2021
395f446
Merge pull request #2 from true-eye/governance
true-eye Mar 1, 2021
c150f40
remove unnecessary parts
true-eye Mar 1, 2021
c01efb9
Merge pull request #3 from true-eye/code-clean
true-eye Mar 1, 2021
33d60e3
update sdk version, added background image & gradientColor
true-eye Mar 10, 2021
5909194
JSChannel update localhost:8080
true-eye Mar 10, 2021
e2d333e
signAsync updated, polkadot/api version updated
true-eye Mar 10, 2021
7a3af0e
backgroundImage added
true-eye Mar 10, 2021
959a35d
update metadata of chainX
true-eye Mar 11, 2021
60732b5
flutter_svg version update, tokenDecimals, tokenSymbol update
true-eye Mar 12, 2021
de601b9
tokenSymbol & tokenDecimals update in plugin
true-eye Mar 12, 2021
3a7dbc5
flutter_svg update
true-eye Mar 12, 2021
39573cf
update flutter_svg as ^0.19.3
true-eye Mar 12, 2021
ddbbb21
update images, package version, svg file, validatorData
true-eye Mar 12, 2021
bc56085
bg updated
true-eye Mar 12, 2021
ced1737
chain_gray, chain, PCX image updated
true-eye Mar 12, 2021
9af7780
update signTxAsExtension signBytesAsExtension
true-eye Apr 1, 2021
6681c68
update chainx.png
true-eye Apr 1, 2021
18e99f2
registeredAt for int
true-eye Apr 1, 2021
19ec9ea
fix error
true-eye Apr 1, 2021
0c5402d
polkawallet_sdk update
true-eye Apr 1, 2021
2c497d9
node url updated
true-eye Apr 1, 2021
fb8cfb2
padding fix
true-eye Apr 1, 2021
1659c6c
validator icon
true-eye Apr 1, 2021
f61ee75
vote menu
true-eye Apr 7, 2021
27f6c8c
vote more option
true-eye Apr 7, 2021
5008efd
add refresh button
true-eye Apr 7, 2021
a151ee0
refresh button
true-eye Apr 7, 2021
31c2016
claim interest
true-eye Apr 7, 2021
7bb0022
add claim interest route
true-eye Apr 7, 2021
c4c4802
unbound
true-eye Apr 7, 2021
d447e76
unbound arg data defined
true-eye Apr 7, 2021
4561dea
unbond instead of unbound
true-eye Apr 7, 2021
d78e37c
string to int for lockedUntil
true-eye Apr 7, 2021
6186be8
string to int value
true-eye Apr 7, 2021
f46b25e
Bigint for int
true-eye Apr 7, 2021
a7d6ece
rebond dropdown dummy
true-eye Apr 7, 2021
be643ac
add rebond route
true-eye Apr 7, 2021
ed8db35
switch case
true-eye Apr 7, 2021
9102f19
link rebond page
true-eye Apr 7, 2021
fbbf5fc
validator dropdown
true-eye Apr 7, 2021
d086112
customDropdown seperated
true-eye Apr 7, 2021
0f60060
dropdown item customization
true-eye Apr 7, 2021
78377f5
customize to validator
true-eye Apr 7, 2021
9d9e554
address dropdown item added
true-eye Apr 7, 2021
633125d
remove padding for address item
true-eye Apr 7, 2021
ce569ff
give auto height for dropdown
true-eye Apr 7, 2021
28127ff
dropdown button style
true-eye Apr 7, 2021
cb576ec
item height
true-eye Apr 7, 2021
6753cc2
enable style
true-eye Apr 7, 2021
fcbf868
height 48
true-eye Apr 7, 2021
8607241
height 40
true-eye Apr 7, 2021
932fa27
44
true-eye Apr 7, 2021
58df30f
padding 3
true-eye Apr 7, 2021
49db440
validator address
true-eye Apr 7, 2021
9941a77
validator to
true-eye Apr 7, 2021
07b601d
Merge pull request #4 from true-eye/xStaking
true-eye Apr 7, 2021
f4fd221
accountIndex updated
true-eye Apr 20, 2021
627abfe
updated validator name
true-eye Apr 20, 2021
df63624
fix string comparison
true-eye Apr 20, 2021
0a2e310
update displayAccountName UI dependency as local
true-eye Apr 20, 2021
b889871
rebond path fixed
true-eye Apr 20, 2021
8588f92
unfreeze added
true-eye Apr 20, 2021
399dd42
unfreeze ui done
true-eye Apr 20, 2021
225f62a
chunk index fix
true-eye Apr 20, 2021
0692cbb
update for v0.1.6
true-eye Apr 23, 2021
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
*.iws
.idea/

# nodejs modules
lib/js_service_chainx/node_modules/
lib/js_service_chainx/test/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# polkawallet_plugin_kusama
# polkawallet_plugin_chainx

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Bodassss These commits were very old and is for another chain. Also it was supposed to be rebase as all those commits' comments are not described correctly. Please close this PR.


Basic plugin for polkawallet/app. Support Polkadot & Kusama.
Basic plugin for polkawallet/app. Support ChainX.

## Getting Started

Expand All @@ -9,6 +9,6 @@ This project is a starting point for a Dart
a library module containing code that can be shared easily across
multiple Flutter or Dart projects.

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
Binary file added assets/images/public/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/public/chainx.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/public/chainx_gray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/public/governance_black.png
Binary file not shown.
Binary file removed assets/images/public/governance_pink.png
Binary file not shown.
Binary file added assets/images/public/governance_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/public/kusama.png
Binary file not shown.
Binary file removed assets/images/public/kusama_gray.png
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/images/public/nav_governance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions assets/images/public/nav_staking.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/public/polkadot.png
Binary file not shown.
Binary file removed assets/images/public/polkadot_gray.png
Binary file not shown.
Binary file removed assets/images/public/staking_black.png
Binary file not shown.
Binary file removed assets/images/public/staking_pink.png
Binary file not shown.
Binary file added assets/images/public/staking_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/tokens/DOT.png
Binary file not shown.
Binary file removed assets/images/tokens/KSM.png
Binary file not shown.
Binary file added assets/images/tokens/PCX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# example

polkawallet_plugin_kusama_example.
polkawallet_plugin_chainx_example.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.polkawallet.www.plugin.kusama.example"
applicationId "io.polkawallet.www.plugin.chainx.example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.polkawallet.www.plugin.kusama.example">
package="io.polkawallet.www.plugin.chainx.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.polkawallet.www.plugin.kusama.example">
package="io.polkawallet.www.plugin.chainx.example">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.polkawallet.www.plugin.kusama.example
package io.polkawallet.www.plugin.chainx.example

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.polkawallet.www.plugin.kusama.example">
package="io.polkawallet.www.plugin.chainx.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -431,7 +431,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -458,7 +458,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.kusama.example;
PRODUCT_BUNDLE_IDENTIFIER = io.polkawallet.www.plugin.chainx.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
15 changes: 7 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:polkawallet_plugin_kusama_example/pages/assetsContent.dart';
import 'package:polkawallet_plugin_kusama_example/pages/profileContent.dart';
import 'package:polkawallet_plugin_kusama_example/pages/selectListPage.dart';
import 'package:polkawallet_plugin_chainx_example/pages/assetsContent.dart';
import 'package:polkawallet_plugin_chainx_example/pages/profileContent.dart';
import 'package:polkawallet_plugin_chainx_example/pages/selectListPage.dart';

import 'package:polkawallet_sdk/api/types/networkParams.dart';
import 'package:polkawallet_sdk/plugin/index.dart';
import 'package:polkawallet_sdk/storage/keyring.dart';
import 'package:polkawallet_sdk/storage/types/keyPairData.dart';
import 'package:polkawallet_sdk/utils/i18n.dart';
import 'package:polkawallet_plugin_kusama/polkawallet_plugin_kusama.dart';
import 'package:polkawallet_plugin_kusama_example/pages/homePage.dart';
import 'package:polkawallet_plugin_chainx/polkawallet_plugin_chainx.dart';
import 'package:polkawallet_plugin_chainx_example/pages/homePage.dart';
import 'package:polkawallet_ui/components/passwordInputDialog.dart';
import 'package:polkawallet_ui/pages/accountListPage.dart';
import 'package:polkawallet_ui/pages/qrSenderPage.dart';
Expand All @@ -20,8 +20,7 @@ import 'package:polkawallet_ui/pages/txConfirmPage.dart';

void main() {
final _plugins = [
PluginKusama(name: 'polkadot'),
PluginKusama(),
PluginChainX(),
];

runApp(MyApp(_plugins));
Expand Down Expand Up @@ -171,7 +170,7 @@ class _MyAppState extends State<MyApp> {
_changeLang);
final AssetsContent assets = AssetsContent(_network, _keyring);
return MaterialApp(
title: 'Polkawallet Plugin Kusama Demo',
title: 'Polkawallet Plugin ChainX Demo',
theme: _theme ?? _getAppTheme(widget.plugins[0].basic.primaryColor),
localizationsDelegates: [
AppLocalizationsDelegate(_locale ?? Locale('en', '')),
Expand Down
35 changes: 10 additions & 25 deletions example/lib/pages/assetsContent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ class AssetsContent extends StatefulWidget {
}

class _AssetsContentState extends State<AssetsContent> {
bool _loading = false;

@override
Widget build(BuildContext context) {
return Observer(
builder: (_) {
final symbol = (widget.network.networkState.tokenSymbol ?? [''])[0];
final decimals = (widget.network.networkState.tokenDecimals ?? [12])[0];
final symbol = (widget.network.networkState.tokenSymbol ?? ['PCX'])[0];
final decimals = (widget.network.networkState.tokenDecimals ?? [8])[0];

final balancesInfo = widget.network.balances.native;
final tokens = widget.network.balances.tokens;
Expand All @@ -46,9 +44,8 @@ class _AssetsContentState extends State<AssetsContent> {
children: [
Text('address'),
Text(widget.keyring.current.address ?? ''),
Text(
'decimals: ${widget.network.networkState.tokenDecimals}'),
Text('symbol: ${widget.network.networkState.tokenSymbol}'),
Text('decimals: $decimals'),
Text('symbol: $symbol'),
],
),
),
Expand Down Expand Up @@ -83,16 +80,8 @@ class _AssetsContentState extends State<AssetsContent> {
),
title: Text(symbol),
trailing: Text(
Fmt.priceFloorBigInt(
balancesInfo != null
? Fmt.balanceTotal(balancesInfo)
: BigInt.zero,
decimals,
lengthFixed: 3),
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 20,
color: Colors.black54),
Fmt.priceFloorBigInt(balancesInfo != null ? Fmt.balanceTotal(balancesInfo) : BigInt.zero, decimals, lengthFixed: 3),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
),
// onTap: () {
// Navigator.pushNamed(context, AssetPage.route);
Expand Down Expand Up @@ -130,8 +119,7 @@ class _AssetsContentState extends State<AssetsContent> {
e,
decimals,
detailPageRoute: e.detailPageRoute,
icon:
widget.network.tokenIcons[e.symbol],
icon: widget.network.tokenIcons[e.symbol],
))
.toList(),
)
Expand Down Expand Up @@ -170,16 +158,13 @@ class TokenItem extends StatelessWidget {
),
title: Text(item.name),
trailing: Text(
Fmt.priceFloorBigInt(Fmt.balanceInt(item.amount), decimals,
lengthFixed: 3),
style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
Fmt.priceFloorBigInt(Fmt.balanceInt(item.amount), decimals, lengthFixed: 3),
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20, color: Colors.black54),
),
onTap: detailPageRoute == null
? null
: () {
Navigator.of(context)
.pushNamed(detailPageRoute, arguments: item);
Navigator.of(context).pushNamed(detailPageRoute, arguments: item);
},
),
);
Expand Down
Loading