update ethereum

This commit is contained in:
emochka2007 2024-05-25 01:49:53 +03:00
parent fa6f595736
commit 5f97b641c0
2 changed files with 14 additions and 3 deletions

View File

@ -1,17 +1,20 @@
import { Controller, Get, Param } from '@nestjs/common';
import { Body, Controller, Get, Param } from '@nestjs/common';
import { EthereumService } from './ethereum.service';
import { ApiTags } from '@nestjs/swagger';
import { GetSeedPhraseDto } from './ethereum.dto';
@ApiTags('Ethereum')
@Controller()
export class EthereumController {
constructor(private readonly ethereumService: EthereumService) {}
@Get('/address/:privateKey')
async getAddressFromPrivateKey(@Param('privateKey') privateKey: string) {
return this.ethereumService.getAddressFromPrivateKey(privateKey);
}
@Get('/address-from-seed/:seedPhrase')
async getAddressFromSeedPhrase(@Param('seedPhrase') seedPhrase: string) {
return this.ethereumService.getAddressFromSeedPhrase(seedPhrase);
async getAddressFromSeedPhrase(@Body() body: GetSeedPhraseDto) {
return this.ethereumService.getAddressFromSeedPhrase(body.seedPhrase);
}
}

View File

@ -0,0 +1,8 @@
import {IsString} from "class-validator";
import {ApiProperty} from "@nestjs/swagger";
export class GetSeedPhraseDto {
@ApiProperty()
@IsString()
seedPhrase: string;
}