Skip to content

Commit

Permalink
update laminar js api to fix issue #133
Browse files Browse the repository at this point in the history
  • Loading branch information
RomeroYang committed Aug 13, 2020
1 parent 00a4ec7 commit 1a30493
Show file tree
Hide file tree
Showing 14 changed files with 10,271 additions and 30 deletions.
2 changes: 1 addition & 1 deletion ios/Flutter/.last_build_id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
21550ad233f9eb1230b6dc6301eb3cf0
c037ac044b13ecbf47a895de46b54202
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -518,7 +518,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -548,7 +548,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = WQ5H736A22;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down
10 changes: 5 additions & 5 deletions lib/common/consts/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ const String cross_chain_transfer_address_laminar =
'5CLaminarAUSDCrossChainTransferxxxxxxxxxxxxxwisu';

/// app versions
const String app_beta_version = '0.9.1-beta.1';
const String app_beta_version = '0.9.1-beta.2';

/// js code versions
const Map<String, int> js_code_version_map = {
network_name_polkadot: 9110,
network_name_kusama: 9110,
network_name_acala_mandala: 9110,
network_name_laminar_turbulence: 9110,
network_name_polkadot: 9120,
network_name_kusama: 9120,
network_name_acala_mandala: 9120,
network_name_laminar_turbulence: 9120,
};

/// graphql for laminar
Expand Down
14 changes: 8 additions & 6 deletions lib/js_service_laminar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@
},
"resolutions": {
"@open-web3/orml-types": "0.3.0-beta.9",
"@polkadot/api": "1.23.1",
"@laminar/api": "0.2.0-beta.127",
"@laminar/types": "0.2.0-beta.127"
"@polkadot/api": "1.27.1",
"@laminar/api": "0.2.0-beta.137",
"@laminar/types": "0.2.0-beta.137",
"@laminar/type-definitions": "0.2.0-beta.137"
},
"dependencies": {
"@babel/polyfill": "^7.8.3",
"@open-web3/orml-types": "^0.3.0-beta.9",
"@polkadot/api": "^1.23.1",
"@polkadot/api": "^1.27.1",
"@polkadot/keyring": "^3.1.0-beta.0",
"@laminar/api": "^0.2.0-beta.127",
"@laminar/types": "^0.2.0-beta.127",
"@laminar/api": "^0.2.0-beta.137",
"@laminar/types": "^0.2.0-beta.137",
"@laminar/type-definitions": "0.2.0-beta.137",
"@polkadot/ui-shared": "^0.51.1",
"bn.js": "^5.1.1"
},
Expand Down
10,246 changes: 10,246 additions & 0 deletions lib/js_service_laminar/yarn.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions lib/page-laminar/margin/laminarMarginPositionItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class LaminarMarginPosition extends StatelessWidget {

@override
Widget build(BuildContext context) {
if (pairData == null) return Container();

final Map dic = I18n.of(context).laminar;
final String direction =
RegExp(r'^Long(.*)$').hasMatch(position['args'][4]) ? 'long' : 'short';
Expand Down
2 changes: 1 addition & 1 deletion lib/page-laminar/margin/laminarMarginPositions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class _LaminarMarginPageWrapperState extends State<LaminarMarginPageWrapper> {
isLoading: false,
)
]
: list.reversed.map((e) {
: list.map((e) {
final LaminarMarginPairData pairData =
_getPairData(e);
return LaminarMarginPosition(
Expand Down
3 changes: 1 addition & 2 deletions lib/page-laminar/margin/laminarMarginTradePairSelector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ class _LaminarMarginTradePairSelectorState
final poolId = _poolId ?? widget.initialPoolId;
final List<LaminarMarginPairData> pairs =
widget.store.laminar.marginPoolInfo[poolId].options.toList();
pairs.retainWhere(
(e) => e.enabled && e.askSpread != null && e.bidSpread != null);
pairs.retainWhere((e) => e.askSpread != null && e.bidSpread != null);
return Container(
height: MediaQuery.of(context).copyWith().size.height / 2,
color: Theme.of(context).cardColor,
Expand Down
3 changes: 1 addition & 2 deletions lib/store/laminar/laminar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ abstract class _LaminarStore with Store {
syntheticPoolInfo.keys.forEach((key) {
final List<LaminarSyntheticPoolTokenData> ls =
syntheticPoolInfo[key].options.toList();
ls.retainWhere((e) =>
e.syntheticEnabled && e.askSpread != null && e.bidSpread != null);
ls.retainWhere((e) => e.askSpread != null && e.bidSpread != null);
res.addAll(ls);
});
return res;
Expand Down
1 change: 0 additions & 1 deletion lib/store/laminar/types/laminarMarginData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ abstract class _LaminarMarginPoolPairData {
String pairId;
dynamic bidSpread;
dynamic askSpread;
bool enabled;
List<String> enabledTrades;
LaminarMarginPairItemData pair;
}
Expand Down
2 changes: 0 additions & 2 deletions lib/store/laminar/types/laminarMarginData.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions lib/store/laminar/types/laminarSyntheticData.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,5 @@ abstract class _LaminarSyntheticPoolTokenData {
String tokenId;
dynamic bidSpread;
dynamic askSpread;
double additionalCollateralRatio;
bool syntheticEnabled;
String additionalCollateralRatio;
}
5 changes: 1 addition & 4 deletions lib/store/laminar/types/laminarSyntheticData.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ description: PolkaWallet made with Flutter.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.9.1+911
version: 0.9.1+912

environment:
sdk: ">=2.1.0 <3.0.0"
Expand Down

0 comments on commit 1a30493

Please sign in to comment.