Skip to content

Instantly share code, notes, and snippets.

View raress96's full-sized avatar

Rareș raress96

View GitHub Profile
@raress96
raress96 / contract.rs
Created April 4, 2022 11:43
Elrond smart contract verify signature
fn verify_signature(
&self,
caller: &ManagedAddress,
url: &ManagedBuffer,
signature: &Signature<Self::Api>,
) {
let mut data = ManagedBuffer::new();
data.append(caller.as_managed_buffer());
data.append(url);
@raress96
raress96 / auth.controller.ts
Created April 4, 2022 09:26
Elrond generate jwt
import { BadRequestException, Body, Controller, Post, UseGuards } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { CachingService } from '../../common/caching/caching.service';
import { randomBytes } from 'crypto';
import { Constants } from '../../utils/constants';
import { JwtService } from '@nestjs/jwt';
import { LoginDto } from './dto/login.dto';
import { Address, SignableMessage, UserPublicKey } from '@elrondnetwork/erdjs/out';
import { ThrottlerBehindProxyGuard } from '../../common/throttle/throttle.guard';