This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "client-app", | |
| "version": "0.0.0", | |
| "scripts": { | |
| "ng": "ng", | |
| "start": "ng serve", | |
| "build": "ng build", | |
| "lint": "ng lint", | |
| "clean:dist": "rimraf ./dist/", | |
| "clean:node_modules": "rimraf ./node_modules/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "architect": { | |
| "build": { | |
| "builder": "@angular-builders/custom-webpack:browser", | |
| "options": { | |
| "customWebpackConfig": { | |
| "path": "./extra-webpack.config.js" | |
| } , | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| node: { | |
| crypto: true, | |
| http: true, | |
| https: true, | |
| os: true, | |
| vm: true, | |
| stream: true | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.5.2; | |
| contract PokemonAttack { | |
| //this declares a state variable which means it belongs to the contract's state | |
| //This will give us a way to store a string value to the blockchain inside the smart contract. | |
| string attack; | |
| constructor(string memory initialAttack) public { | |
| attack = initialAttack; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { InjectionToken} from '@angular/core'; | |
| import Web3 from 'web3'; | |
| import TruffleContract from 'truffle-contract'; | |
| import ContractAbi from '../../../../build/contracts/PokemonAttack.json'; | |
| export const WEB3 = new InjectionToken<Web3>('web3Token', { | |
| providedIn: 'root', | |
| factory: () => { | |
| // based on https://medium.com/metamask/https-medium-com-metamask-breaking-change-injecting-web3-7722797916a8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { Routes, RouterModule } from '@angular/router'; | |
| import { PokemonComponent } from './components/pokemon/pokemon.component'; | |
| const routes: Routes = [ | |
| { | |
| path: '', redirectTo: '/pokey-home', pathMatch: 'full', | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { CanActivate } from '@angular/router'; | |
| import { Store, select } from '@ngrx/store'; | |
| import { Observable, of } from 'rxjs'; | |
| import { map, take, tap, filter, switchMap, catchError } from 'rxjs/operators'; | |
| import {EthAnchorModule} from '../eth.anchor.module'; | |
| import * as fromEth from '../../ethereum'; | |
| @Injectable({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { NgModule } from '@angular/core'; | |
| import { Routes, RouterModule } from '@angular/router'; | |
| import * as guards from './guards'; | |
| import { EthPanelComponent } from './components/eth-panel/eth-panel.component'; | |
| const routes: Routes = [ | |
| { | |
| path: '', | |
| component: EthPanelComponent, | |
| canActivate: [guards.EthInitGuard], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable, Inject } from '@angular/core'; | |
| import { Effect, Actions, ofType } from '@ngrx/effects'; | |
| import { Action } from '@ngrx/store'; | |
| import { Observable, of, from } from 'rxjs'; | |
| import {exhaustMap, switchMap, map, tap, catchError } from 'rxjs/operators'; | |
| import { WEB3, SmartContract } from '../services/tokens'; | |
| import Web3 from 'web3'; | |
| import {TruffleContract} from 'truffle-contract'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnInit, OnDestroy } from '@angular/core'; | |
| import { FormBuilder, FormGroup } from '@angular/forms'; | |
| import { Store, select } from '@ngrx/store'; | |
| import * as fromAttackChange from '../../index'; | |
| import { Observable, Subject } from 'rxjs'; | |
| import { takeUntil, tap } from 'rxjs/operators'; | |
| @Component({ | |
| selector: 'app-attack-change', | |
| templateUrl: './attack-change.component.html', |
OlderNewer