1.0.1 • Published 2 years ago

nestjs-blockcypher v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

nestjs-blockcypher

A Nestjs module for blockcypher-apis

Installation

yarn add nestjs-blockcypher blockcypher-apis
# npm install ...

Usage

app.service.ts

...
import { BlockCypherService } from 'nestjs-blockcypher';
@Injectable()
export class AppService {
  constructor(
    // BlockCypherService is an instance of Client from blockcypher-apis
    private readonly blockCypherService: BlockCypherService,
  )
  
  getTransaction(hash: string) {
    return this.blockCypherService.apis.transaction.getTransactionByHash(hash);
  }
}

app.module.ts

...
import { BlockCypherModule } from 'nestjs-blockcypher';

@Module({
  imports: [BlockCypherModule.register({
    coin: ...,
    chain: ...,
    token: ...,
  })],
  ...
})
export class AppModule {}
1.0.1

2 years ago

1.0.0

3 years ago