Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhixian001/alchemy-api
Alchemy API module for Nest framework
https://github.com/zhixian001/alchemy-api
alchemy alchemyapi nest nestjs nodejs typescript web3
Last synced: 27 days ago
JSON representation
Alchemy API module for Nest framework
- Host: GitHub
- URL: https://github.com/zhixian001/alchemy-api
- Owner: zhixian001
- License: mit
- Created: 2022-04-22T18:44:51.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-04-28T18:22:47.000Z (over 2 years ago)
- Last Synced: 2024-03-15T01:24:02.461Z (8 months ago)
- Topics: alchemy, alchemyapi, nest, nestjs, nodejs, typescript, web3
- Language: TypeScript
- Homepage: https://npmjs.com/package/@darrenyeom/alchemy-api
- Size: 150 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nest Alchemy API module
## Description
[Alchemy Web3 API](https://www.npmjs.com/package/@alch/alchemy-web3) module for [Nest](https://github.com/nestjs/nest).
## Installation
```bash
$ npm i -s @darrenyeom/alchemy-api @alch/alchemy-web3
```## Quickstart
> app.module.ts
```typescript
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/',
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```> app.service.ts
```typescript
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).