0.0.7 • Published 2 years ago

@darrenyeom/alchemy-api v0.0.7

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

Nest Alchemy API module

Description

Alchemy Web3 API module for Nest.

Installation

$ npm i -s @darrenyeom/alchemy-api @alch/alchemy-web3

Quickstart

app.module.ts

import { Module } from '@nestjs/common';
import { AlchemyApiModule } from '@darrenyeom/alchemy-api';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    AlchemyApiModule.forRoot({
      alchemyUrl:
        'wss://eth-mainnet.alchemyapi.io/v2/<API_KEY>',
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

app.service.ts

import { Injectable } from '@nestjs/common';
import { AlchemyApiService } from '@darrenyeom/alchemy-api';

@Injectable() export class AppService { constructor(private readonly alchemyApiService: AlchemyApiService) {}

async getBlockNumber() { return this.alchemyApiService.client.eth.getBlockNumber(); } }

## License

[MIT](LICENSE).
0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago