New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@mailchain/publickey-angular

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@mailchain/publickey-angular

Mailchain Publickey - a service for resolving public keys via the Mailchain API for Angular

unpublished
latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
2
Created
Source

PublickeyAngular

This package is an Angular service that helps query the Mailchain API public-key endpoint.

Installing

npm install @mailchain/publickey-angular --save

Usage

In your Angular app.module.ts file, import the PublickeyAngularModule:


import { PublickeyAngularModule } from '@mailchain/publickey-angular';

@NgModule({
  declarations: [
    AppComponent
    ...
  ],
  imports: [
    ...
    PublickeyAngularModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

In an Angular component file, eg. my-component.component.ts, add the following:

  // import the service
  import { PublickeyService } from '@mailchain/publickey-angular';

  // add to constructor
  constructor(
    private publickeyService: PublickeyService,
  ) { }

  // add to function and then execute logic in the callback
  myFunction() {
    const protocol = "ethereum" // change accordingly or use function params
    const network = "ropsten" // change accordingly or use function params
    const address = "0xd6d77865e128cd727526f45583d707a72eb56eb0" // change accordingly or use function params

    const obs = this.publicKeyService.getPublicKeyFromAddress(address, protocol, network)

    obs.subscribe(obs => {
      console.log(obs['body']) // { "public-key": "0x69d908510e355beb1d5bf2df8129e5b6401e1969891e8016a0b2300739bbb00687055e5924a2fd8dd35f069dc14d8147aa11c1f7e2f271573487e1beeb2be9d0",   "public-key-encoding": "hex/0x-prefix",   "public-key-kind": "secp256k1",   "supported-encryption-types": [     "aes256cbc",     "noop"  ]}
      console.log(obs['body']['public-key'])
    })
  }

This library was generated with Angular CLI version 8.2.14.

Code scaffolding

Run ng generate component component-name --project publickey-angular to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project publickey-angular.

Note: Don't forget to add --project publickey-angular or else it will be added to the default project in your angular.json file.

Build

Run ng build publickey-angular to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build publickey-angular, go to the dist folder cd dist/publickey-angular and run npm publish.

Running unit tests

Run ng test publickey-angular to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

FAQs

Package last updated on 21 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts