@wavesenterprise/we-node-grpc-api-nest
v1.0.5
Published
Waves Enterprise node GRPC API client
Downloads
4
Readme
WE GRPC API service
Wrapper for @wavesenterprise/we-node-grpc-api
Install
$ npm i @wavesenterprise/we-node-grpc-api-nest
or
$ yarn add @wavesenterprise/we-node-grpc-api-nest
Use
// app.module.ts
import { WeGrpcModule } from '@wavesenterprise/we-node-grpc-api-nest'
import { AppService } from './app.service'
@Module({
imports: [
WeGrpcModule.forRoot({
address: NODE_ADDRESS,
metadata: {
authorization: 'api token',
},
}),
],
providers: [AppService],
})
class AppModule {
}
// app.service.ts
import { WeGrpcAddressService } from '@wavesenterprise/we-node-grpc-api-nest'
import { Injectable } from '@nestjs/common'
@Injectable()
class AppService {
constructor(
private readonly addressService: WeGrpcAddressService,
) {
}
async doAction() {
const addresses = await this.addressService.getAddresses()
}
}
Use MetadataManager
to update metadata dynamicly