0.0.1-alpha.2 • Published 1 year ago

@buidly/nestjs-transaction-processor v0.0.1-alpha.2

Weekly downloads
-
License
GPL-3.0-or-later
Repository
-
Last release
1 year ago

MultiversX NestJs Transaction Processor

    TransactionProcessorModule.forRootAsync({
      imports: [
        ApiConfigModule,
        DynamicModuleUtils.getCachingModule(),
      ],
      inject: [ApiConfigService, CachingService],
      useFactory: (apiConfigService: ApiConfigService, cachingService: CachingService) => ({
        gatewayUrl: apiConfigService.getApiUrl(),
        maxLookBehind: apiConfigService.getTransactionProcessorMaxLookBehind(),
        persistence: {
          getLastProcessedNonce: async () => {
            return await cachingService.getCache(`lastProcessedNonce`);
          },
          setLastProcessedNonce: async (nonce: number) => {
            await cachingService.setCache(`lastProcessedNonce`, nonce, Constants.oneMonth());
          },
        },
      }),
    }),