Angular librairies to build Decentralized Application (Dapp) on Ethereum.
@ngeth enables superfast production of Dapp on Ethereum thanks to the Angular front-end framework.
@ngeth allow you to test and run your contract with an Angular oriented syntax, and supports the experimental ABIEncoderV2 of Solidity.
@ngeth is under heavy development. You should expect breaking changes.
Please do not use @ngeth in production mode.
-
@ngeth/provider - The provider to connect to your node. HTTP and WebSocket are supported.
-
@ngeth/utils - Utils to manipulate BigNumbers and Hex values.
-
@ngeth/auth - An Authentication system to either store accounts on the node or on localStorage.
-
@ngeth/contract - The lib to build and manage contracts.
- example - TODO.
Start a traditional Angular app with @angular/cli
ng new ngeth-dapp
cd ngeth-dapp
Then add the provider
and utils
packages.
npm install @ngeth/provider @ngeth/utils --save
In the app.module.ts
file
import { AppComponent } from './app.component';
import { ProviderModule } from '@ngeth/provider';
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
// Connect to an infura node
ProviderModule.init('https://ropsten.infura.io'),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
In the app.component.ts
file
import { Component, OnInit } from '@angular/core';
import { Eth } from '@ngeth/provider';
import { Observable } from 'rxjs';
@Component({
selector: 'app-root',
template: '<p>Current Block: {{ block$ | async }}</p>',
styles: []
})
export class AppComponent implements OnInit {
public block$: Observable<string>;
constructor(private eth: Eth) {}
ngOnInit() {
this.block$ = this.eth.getBlockNumber();
}
}
ng serve
With any browser (no need to use Mist or MetaMask if you provide a node in ProviderModule
).
localhost:4200
François Guezengar – francois.guezengar@b2expand.com Quentin Vaudain - quentin.vaudain@b2expand.com Gabrielle Huëbra - gabrielle.huebra@b2expand.com
Distributed under the MIT license. See LICENSE
for more information.