Khalil Malik Saboor 6 years ago
parent
commit
f86560aff3
30 changed files with 7050 additions and 0 deletions
  1. 17
    0
      ZipCoinRedIonicClient2.0/.editorconfig
  2. 35
    0
      ZipCoinRedIonicClient2.0/.gitignore
  3. 6
    0
      ZipCoinRedIonicClient2.0/ionic.config.json
  4. 6504
    0
      ZipCoinRedIonicClient2.0/package-lock.json
  5. 38
    0
      ZipCoinRedIonicClient2.0/package.json
  6. 22
    0
      ZipCoinRedIonicClient2.0/src/app/app.component.ts
  7. 1
    0
      ZipCoinRedIonicClient2.0/src/app/app.html
  8. 40
    0
      ZipCoinRedIonicClient2.0/src/app/app.module.ts
  9. 16
    0
      ZipCoinRedIonicClient2.0/src/app/app.scss
  10. 5
    0
      ZipCoinRedIonicClient2.0/src/app/main.ts
  11. BIN
      ZipCoinRedIonicClient2.0/src/assets/icon/favicon.ico
  12. BIN
      ZipCoinRedIonicClient2.0/src/assets/imgs/logo.png
  13. 49
    0
      ZipCoinRedIonicClient2.0/src/index.html
  14. 13
    0
      ZipCoinRedIonicClient2.0/src/manifest.json
  15. 11
    0
      ZipCoinRedIonicClient2.0/src/pages/about/about.html
  16. 3
    0
      ZipCoinRedIonicClient2.0/src/pages/about/about.scss
  17. 14
    0
      ZipCoinRedIonicClient2.0/src/pages/about/about.ts
  18. 17
    0
      ZipCoinRedIonicClient2.0/src/pages/contact/contact.html
  19. 3
    0
      ZipCoinRedIonicClient2.0/src/pages/contact/contact.scss
  20. 14
    0
      ZipCoinRedIonicClient2.0/src/pages/contact/contact.ts
  21. 22
    0
      ZipCoinRedIonicClient2.0/src/pages/home/home.html
  22. 3
    0
      ZipCoinRedIonicClient2.0/src/pages/home/home.scss
  23. 14
    0
      ZipCoinRedIonicClient2.0/src/pages/home/home.ts
  24. 5
    0
      ZipCoinRedIonicClient2.0/src/pages/tabs/tabs.html
  25. 19
    0
      ZipCoinRedIonicClient2.0/src/pages/tabs/tabs.ts
  26. 21
    0
      ZipCoinRedIonicClient2.0/src/providers/block-service.ts
  27. 31
    0
      ZipCoinRedIonicClient2.0/src/service-worker.js
  28. 88
    0
      ZipCoinRedIonicClient2.0/src/theme/variables.scss
  29. 28
    0
      ZipCoinRedIonicClient2.0/tsconfig.json
  30. 11
    0
      ZipCoinRedIonicClient2.0/tslint.json

+ 17
- 0
ZipCoinRedIonicClient2.0/.editorconfig View File

@@ -0,0 +1,17 @@
1
+# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2
+# editorconfig.org
3
+
4
+root = true
5
+
6
+[*]
7
+indent_style = space
8
+indent_size = 2
9
+
10
+# We recommend you to keep these unchanged
11
+end_of_line = lf
12
+charset = utf-8
13
+trim_trailing_whitespace = true
14
+insert_final_newline = true
15
+
16
+[*.md]
17
+trim_trailing_whitespace = false

+ 35
- 0
ZipCoinRedIonicClient2.0/.gitignore View File

@@ -0,0 +1,35 @@
1
+# Specifies intentionally untracked files to ignore when using Git
2
+# http://git-scm.com/docs/gitignore
3
+
4
+*~
5
+*.sw[mnpcod]
6
+*.log
7
+*.tmp
8
+*.tmp.*
9
+log.txt
10
+*.sublime-project
11
+*.sublime-workspace
12
+.vscode/
13
+npm-debug.log*
14
+
15
+.idea/
16
+.ionic/
17
+.sourcemaps/
18
+.sass-cache/
19
+.tmp/
20
+.versions/
21
+coverage/
22
+dist/
23
+node_modules/
24
+tmp/
25
+temp/
26
+platforms/
27
+plugins/
28
+plugins/android.json
29
+plugins/ios.json
30
+www/
31
+$RECYCLE.BIN/
32
+
33
+.DS_Store
34
+Thumbs.db
35
+UserInterfaceState.xcuserstate

+ 6
- 0
ZipCoinRedIonicClient2.0/ionic.config.json View File

@@ -0,0 +1,6 @@
1
+{
2
+  "name": "ZipCoinRedIonicClient2.0",
3
+  "app_id": "",
4
+  "type": "ionic-angular",
5
+  "integrations": {}
6
+}

+ 6504
- 0
ZipCoinRedIonicClient2.0/package-lock.json
File diff suppressed because it is too large
View File


+ 38
- 0
ZipCoinRedIonicClient2.0/package.json View File

@@ -0,0 +1,38 @@
1
+{
2
+  "name": "ZipCoinRedIonicClient2.0",
3
+  "version": "0.0.1",
4
+  "author": "Ionic Framework",
5
+  "homepage": "http://ionicframework.com/",
6
+  "private": true,
7
+  "scripts": {
8
+    "start": "ionic-app-scripts serve",
9
+    "clean": "ionic-app-scripts clean",
10
+    "build": "ionic-app-scripts build",
11
+    "lint": "ionic-app-scripts lint"
12
+  },
13
+  "dependencies": {
14
+    "@angular/animations": "5.2.11",
15
+    "@angular/common": "5.2.11",
16
+    "@angular/compiler": "5.2.11",
17
+    "@angular/compiler-cli": "5.2.11",
18
+    "@angular/core": "5.2.11",
19
+    "@angular/forms": "5.2.11",
20
+    "@angular/http": "5.2.11",
21
+    "@angular/platform-browser": "5.2.11",
22
+    "@angular/platform-browser-dynamic": "5.2.11",
23
+    "@ionic-native/core": "~4.10.0",
24
+    "@ionic-native/splash-screen": "~4.10.0",
25
+    "@ionic-native/status-bar": "~4.10.0",
26
+    "@ionic/storage": "2.1.3",
27
+    "ionic-angular": "3.9.2",
28
+    "ionicons": "3.0.0",
29
+    "rxjs": "5.5.11",
30
+    "sw-toolbox": "3.6.0",
31
+    "zone.js": "0.8.26"
32
+  },
33
+  "devDependencies": {
34
+    "@ionic/app-scripts": "3.1.11",
35
+    "typescript": "~2.6.2"
36
+  },
37
+  "description": "An Ionic project"
38
+}

+ 22
- 0
ZipCoinRedIonicClient2.0/src/app/app.component.ts View File

@@ -0,0 +1,22 @@
1
+import { Component } from '@angular/core';
2
+import { Platform } from 'ionic-angular';
3
+import { StatusBar } from '@ionic-native/status-bar';
4
+import { SplashScreen } from '@ionic-native/splash-screen';
5
+
6
+import { TabsPage } from '../pages/tabs/tabs';
7
+
8
+@Component({
9
+  templateUrl: 'app.html'
10
+})
11
+export class MyApp {
12
+  rootPage:any = TabsPage;
13
+
14
+  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
15
+    platform.ready().then(() => {
16
+      // Okay, so the platform is ready and our plugins are available.
17
+      // Here you can do any higher level native things you might need.
18
+      statusBar.styleDefault();
19
+      splashScreen.hide();
20
+    });
21
+  }
22
+}

+ 1
- 0
ZipCoinRedIonicClient2.0/src/app/app.html View File

@@ -0,0 +1 @@
1
+<ion-nav [root]="rootPage"></ion-nav>

+ 40
- 0
ZipCoinRedIonicClient2.0/src/app/app.module.ts View File

@@ -0,0 +1,40 @@
1
+import { NgModule, ErrorHandler } from '@angular/core';
2
+import { BrowserModule } from '@angular/platform-browser';
3
+import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
4
+import { MyApp } from './app.component';
5
+
6
+import { AboutPage } from '../pages/about/about';
7
+import { ContactPage } from '../pages/contact/contact';
8
+import { HomePage } from '../pages/home/home';
9
+import { TabsPage } from '../pages/tabs/tabs';
10
+
11
+import { StatusBar } from '@ionic-native/status-bar';
12
+import { SplashScreen } from '@ionic-native/splash-screen';
13
+
14
+@NgModule({
15
+  declarations: [
16
+    MyApp,
17
+    AboutPage,
18
+    ContactPage,
19
+    HomePage,
20
+    TabsPage
21
+  ],
22
+  imports: [
23
+    BrowserModule,
24
+    IonicModule.forRoot(MyApp)
25
+  ],
26
+  bootstrap: [IonicApp],
27
+  entryComponents: [
28
+    MyApp,
29
+    AboutPage,
30
+    ContactPage,
31
+    HomePage,
32
+    TabsPage
33
+  ],
34
+  providers: [
35
+    StatusBar,
36
+    SplashScreen,
37
+    {provide: ErrorHandler, useClass: IonicErrorHandler}
38
+  ]
39
+})
40
+export class AppModule {}

+ 16
- 0
ZipCoinRedIonicClient2.0/src/app/app.scss View File

@@ -0,0 +1,16 @@
1
+// http://ionicframework.com/docs/theming/
2
+
3
+
4
+// App Global Sass
5
+// --------------------------------------------------
6
+// Put style rules here that you want to apply globally. These
7
+// styles are for the entire app and not just one component.
8
+// Additionally, this file can be also used as an entry point
9
+// to import other Sass files to be included in the output CSS.
10
+//
11
+// Shared Sass variables, which can be used to adjust Ionic's
12
+// default Sass variables, belong in "theme/variables.scss".
13
+//
14
+// To declare rules for a specific mode, create a child rule
15
+// for the .md, .ios, or .wp mode classes. The mode class is
16
+// automatically applied to the <body> element in the app.

+ 5
- 0
ZipCoinRedIonicClient2.0/src/app/main.ts View File

@@ -0,0 +1,5 @@
1
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2
+
3
+import { AppModule } from './app.module';
4
+
5
+platformBrowserDynamic().bootstrapModule(AppModule);

BIN
ZipCoinRedIonicClient2.0/src/assets/icon/favicon.ico View File


BIN
ZipCoinRedIonicClient2.0/src/assets/imgs/logo.png View File


+ 49
- 0
ZipCoinRedIonicClient2.0/src/index.html View File

@@ -0,0 +1,49 @@
1
+<!DOCTYPE html>
2
+<html lang="en" dir="ltr">
3
+<head>
4
+  <meta charset="UTF-8">
5
+  <title>Ionic App</title>
6
+  <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
7
+  <meta name="format-detection" content="telephone=no">
8
+  <meta name="msapplication-tap-highlight" content="no">
9
+
10
+  <link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
11
+  <link rel="manifest" href="manifest.json">
12
+  <meta name="theme-color" content="#4e8ef7">
13
+
14
+  <!-- add to homescreen for ios -->
15
+  <meta name="apple-mobile-web-app-capable" content="yes">
16
+  <meta name="apple-mobile-web-app-status-bar-style" content="black">
17
+
18
+  <!-- cordova.js required for cordova apps (remove if not needed) -->
19
+  <script src="cordova.js"></script>
20
+
21
+  <!-- un-comment this code to enable service worker
22
+  <script>
23
+    if ('serviceWorker' in navigator) {
24
+      navigator.serviceWorker.register('service-worker.js')
25
+        .then(() => console.log('service worker installed'))
26
+        .catch(err => console.error('Error', err));
27
+    }
28
+  </script>-->
29
+
30
+  <link href="build/main.css" rel="stylesheet">
31
+
32
+</head>
33
+<body>
34
+
35
+  <!-- Ionic's root component and where the app will load -->
36
+  <ion-app></ion-app>
37
+
38
+  <!-- The polyfills js is generated during the build process -->
39
+  <script src="build/polyfills.js"></script>
40
+
41
+  <!-- The vendor js is generated during the build process
42
+       It contains all of the dependencies in node_modules -->
43
+  <script src="build/vendor.js"></script>
44
+
45
+  <!-- The main bundle js is generated during the build process -->
46
+  <script src="build/main.js"></script>
47
+
48
+</body>
49
+</html>

+ 13
- 0
ZipCoinRedIonicClient2.0/src/manifest.json View File

@@ -0,0 +1,13 @@
1
+{
2
+  "name": "Ionic",
3
+  "short_name": "Ionic",
4
+  "start_url": "index.html",
5
+  "display": "standalone",
6
+  "icons": [{
7
+    "src": "assets/imgs/logo.png",
8
+    "sizes": "512x512",
9
+    "type": "image/png"
10
+  }],
11
+  "background_color": "#4e8ef7",
12
+  "theme_color": "#4e8ef7"
13
+}

+ 11
- 0
ZipCoinRedIonicClient2.0/src/pages/about/about.html View File

@@ -0,0 +1,11 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>
4
+      About
5
+    </ion-title>
6
+  </ion-navbar>
7
+</ion-header>
8
+
9
+<ion-content padding>
10
+
11
+</ion-content>

+ 3
- 0
ZipCoinRedIonicClient2.0/src/pages/about/about.scss View File

@@ -0,0 +1,3 @@
1
+page-about {
2
+
3
+}

+ 14
- 0
ZipCoinRedIonicClient2.0/src/pages/about/about.ts View File

@@ -0,0 +1,14 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+
4
+@Component({
5
+  selector: 'page-about',
6
+  templateUrl: 'about.html'
7
+})
8
+export class AboutPage {
9
+
10
+  constructor(public navCtrl: NavController) {
11
+
12
+  }
13
+
14
+}

+ 17
- 0
ZipCoinRedIonicClient2.0/src/pages/contact/contact.html View File

@@ -0,0 +1,17 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>
4
+      Contact
5
+    </ion-title>
6
+  </ion-navbar>
7
+</ion-header>
8
+
9
+<ion-content>
10
+  <ion-list>
11
+    <ion-list-header>Follow us on Twitter</ion-list-header>
12
+    <ion-item>
13
+      <ion-icon name="ionic" item-start></ion-icon>
14
+      @ionicframework
15
+    </ion-item>
16
+  </ion-list>
17
+</ion-content>

+ 3
- 0
ZipCoinRedIonicClient2.0/src/pages/contact/contact.scss View File

@@ -0,0 +1,3 @@
1
+page-contact {
2
+
3
+}

+ 14
- 0
ZipCoinRedIonicClient2.0/src/pages/contact/contact.ts View File

@@ -0,0 +1,14 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+
4
+@Component({
5
+  selector: 'page-contact',
6
+  templateUrl: 'contact.html'
7
+})
8
+export class ContactPage {
9
+
10
+  constructor(public navCtrl: NavController) {
11
+
12
+  }
13
+
14
+}

+ 22
- 0
ZipCoinRedIonicClient2.0/src/pages/home/home.html View File

@@ -0,0 +1,22 @@
1
+<ion-header>
2
+  <ion-navbar>
3
+    <ion-title>
4
+      ZipCoin BlockChain
5
+    </ion-title>
6
+  </ion-navbar>
7
+</ion-header>
8
+
9
+<ion-content padding>
10
+  
11
+  <div class="well well-success col-xs-7" id="blockchain">
12
+       <div class="list list-inset">
13
+          <label class="item item-input"> Block #:<input type="text" disabled placeholder= "{{ block.blockNumber }}" ></label>
14
+          <label class="item item-input"> Nonce:<input type="text" disabled placeholder= "{{ block.nonce }}" ></label>
15
+          <label class="item item-input"> Data:<input type="text" disabled placeholder= "{{ block.transactionList }}" > </label>
16
+          <label class="item item-input"> Hash:<input type="text" disabled placeholder= "{{ block.currentHash }}" ></label>
17
+    <!-- <label class="item item-input"> HashPrev: <input type="text" disabled placeholder="Hash"></label> -->
18
+          <button ion-button (click)="btnClicked()">Mine</button>
19
+        </div>
20
+  </div>   
21
+
22
+</ion-content>

+ 3
- 0
ZipCoinRedIonicClient2.0/src/pages/home/home.scss View File

@@ -0,0 +1,3 @@
1
+page-home {
2
+
3
+}

+ 14
- 0
ZipCoinRedIonicClient2.0/src/pages/home/home.ts View File

@@ -0,0 +1,14 @@
1
+import { Component } from '@angular/core';
2
+import { NavController } from 'ionic-angular';
3
+
4
+@Component({
5
+  selector: 'page-home',
6
+  templateUrl: 'home.html'
7
+})
8
+export class HomePage {
9
+
10
+  constructor(public navCtrl: NavController) {
11
+
12
+  }
13
+
14
+}

+ 5
- 0
ZipCoinRedIonicClient2.0/src/pages/tabs/tabs.html View File

@@ -0,0 +1,5 @@
1
+<ion-tabs>
2
+  <ion-tab [root]="tab1Root" tabTitle="Home" tabIcon="home"></ion-tab>
3
+  <ion-tab [root]="tab2Root" tabTitle="About" tabIcon="information-circle"></ion-tab>
4
+  <ion-tab [root]="tab3Root" tabTitle="Contact" tabIcon="contacts"></ion-tab>
5
+</ion-tabs>

+ 19
- 0
ZipCoinRedIonicClient2.0/src/pages/tabs/tabs.ts View File

@@ -0,0 +1,19 @@
1
+import { Component } from '@angular/core';
2
+
3
+import { AboutPage } from '../about/about';
4
+import { ContactPage } from '../contact/contact';
5
+import { HomePage } from '../home/home';
6
+
7
+@Component({
8
+  templateUrl: 'tabs.html'
9
+})
10
+export class TabsPage {
11
+
12
+  tab1Root = HomePage;
13
+  tab2Root = AboutPage;
14
+  tab3Root = ContactPage;
15
+
16
+  constructor() {
17
+
18
+  }
19
+}

+ 21
- 0
ZipCoinRedIonicClient2.0/src/providers/block-service.ts View File

@@ -0,0 +1,21 @@
1
+import {HttpClient} from "@angular/common/http";
2
+import {Observable} from "rxjs/Observable";
3
+import {Injectable} from "@angular/core";
4
+
5
+@Injectable()
6
+export class BlockService{
7
+ public API = 'http://localhost:8080/api/v1';
8
+ public BLOCK_API = this.API + '/blocks';
9
+ 
10
+ constructor(public http: HttpClient) {
11
+ }
12
+
13
+ getBlock(id) {
14
+   return this.http.get(this.BLOCK_API + '/' + id);
15
+ }
16
+
17
+ getMinedBlock(id) {
18
+  return this.http.get(this.BLOCK_API + '/' + id + '/' + 'mine');
19
+ }
20
+
21
+}

+ 31
- 0
ZipCoinRedIonicClient2.0/src/service-worker.js View File

@@ -0,0 +1,31 @@
1
+/**
2
+ * Check out https://googlechromelabs.github.io/sw-toolbox/ for
3
+ * more info on how to use sw-toolbox to custom configure your service worker.
4
+ */
5
+
6
+
7
+'use strict';
8
+importScripts('./build/sw-toolbox.js');
9
+
10
+self.toolbox.options.cache = {
11
+  name: 'ionic-cache'
12
+};
13
+
14
+// pre-cache our key assets
15
+self.toolbox.precache(
16
+  [
17
+    './build/main.js',
18
+    './build/vendor.js',
19
+    './build/main.css',
20
+    './build/polyfills.js',
21
+    'index.html',
22
+    'manifest.json'
23
+  ]
24
+);
25
+
26
+// dynamically cache any other local assets
27
+self.toolbox.router.any('/*', self.toolbox.fastest);
28
+
29
+// for any other requests go to the network, cache,
30
+// and then only use that cached resource if your user goes offline
31
+self.toolbox.router.default = self.toolbox.networkFirst;

+ 88
- 0
ZipCoinRedIonicClient2.0/src/theme/variables.scss View File

@@ -0,0 +1,88 @@
1
+// Ionic Variables and Theming. For more info, please see:
2
+// http://ionicframework.com/docs/theming/
3
+
4
+// Font path is used to include ionicons,
5
+// roboto, and noto sans fonts
6
+$font-path: "../assets/fonts";
7
+
8
+
9
+// The app direction is used to include
10
+// rtl styles in your app. For more info, please see:
11
+// http://ionicframework.com/docs/theming/rtl-support/
12
+$app-direction: ltr;
13
+
14
+
15
+@import "ionic.globals";
16
+
17
+
18
+// Shared Variables
19
+// --------------------------------------------------
20
+// To customize the look and feel of this app, you can override
21
+// the Sass variables found in Ionic's source scss files.
22
+// To view all the possible Ionic variables, see:
23
+// http://ionicframework.com/docs/theming/overriding-ionic-variables/
24
+
25
+
26
+
27
+
28
+// Named Color Variables
29
+// --------------------------------------------------
30
+// Named colors makes it easy to reuse colors on various components.
31
+// It's highly recommended to change the default colors
32
+// to match your app's branding. Ionic uses a Sass map of
33
+// colors so you can add, rename and remove colors as needed.
34
+// The "primary" color is the only required color in the map.
35
+
36
+$colors: (
37
+  primary:    #488aff,
38
+  secondary:  #32db64,
39
+  danger:     #f53d3d,
40
+  light:      #f4f4f4,
41
+  dark:       #222
42
+);
43
+
44
+
45
+// App iOS Variables
46
+// --------------------------------------------------
47
+// iOS only Sass variables can go here
48
+
49
+
50
+
51
+
52
+// App Material Design Variables
53
+// --------------------------------------------------
54
+// Material Design only Sass variables can go here
55
+
56
+
57
+
58
+
59
+// App Windows Variables
60
+// --------------------------------------------------
61
+// Windows only Sass variables can go here
62
+
63
+
64
+
65
+
66
+// App Theme
67
+// --------------------------------------------------
68
+// Ionic apps can have different themes applied, which can
69
+// then be future customized. This import comes last
70
+// so that the above variables are used and Ionic's
71
+// default are overridden.
72
+
73
+@import "ionic.theme.default";
74
+
75
+
76
+// Ionicons
77
+// --------------------------------------------------
78
+// The premium icon font for Ionic. For more info, please see:
79
+// http://ionicframework.com/docs/ionicons/
80
+
81
+@import "ionic.ionicons";
82
+
83
+
84
+// Fonts
85
+// --------------------------------------------------
86
+
87
+@import "roboto";
88
+@import "noto-sans";

+ 28
- 0
ZipCoinRedIonicClient2.0/tsconfig.json View File

@@ -0,0 +1,28 @@
1
+{
2
+  "compilerOptions": {
3
+    "allowSyntheticDefaultImports": true,
4
+    "declaration": false,
5
+    "emitDecoratorMetadata": true,
6
+    "experimentalDecorators": true,
7
+    "lib": [
8
+      "dom",
9
+      "es2015"
10
+    ],
11
+    "module": "es2015",
12
+    "moduleResolution": "node",
13
+    "sourceMap": true,
14
+    "target": "es5"
15
+  },
16
+  "include": [
17
+    "src/**/*.ts"
18
+  ],
19
+  "exclude": [
20
+    "node_modules",
21
+    "src/**/*.spec.ts",
22
+    "src/**/__tests__/*.ts"
23
+  ],
24
+  "compileOnSave": false,
25
+  "atom": {
26
+    "rewriteTsconfig": false
27
+  }
28
+}

+ 11
- 0
ZipCoinRedIonicClient2.0/tslint.json View File

@@ -0,0 +1,11 @@
1
+{
2
+  "rules": {
3
+    "no-duplicate-variable": true,
4
+    "no-unused-variable": [
5
+      true
6
+    ]
7
+  },
8
+  "rulesDirectory": [
9
+    "node_modules/tslint-eslint-rules/dist/rules"
10
+  ]
11
+}