This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
var web3 = new Web3("ProjectId", "ProjectSecret"); | |
// Get the chain height | |
var block1 = await web3.EthMainNet.Eth.GetBlockNumberAsync(); | |
var block2 = await web3.Optimism.Eth.GetBlockNumberAsync(); | |
// Query USDT balance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="w-full sm:w-5/6 md:w-4/5 lg:w-3/4 mx-auto px-4 py-6"> | |
@ChildContent | |
</div> | |
@code { | |
[Parameter] | |
public RenderFragment? ChildContent { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
var authHeader = Request.Headers.Authorization.ToString(); | |
if (!authHeader.StartsWith("Basic ")) | |
return Unauthorized(); | |
var apiSecretHash = Encoding.ASCII.GetString(Convert.FromBase64String(authHeader[6..])) | |
.Split(':')[1] | |
.ToSha256(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, Inject, OnInit, Renderer2} from '@angular/core'; | |
import {PaymentService} from "../../services/payment.service"; | |
import {DOCUMENT} from '@angular/common'; | |
@Component({ | |
selector: 'app-subscription-checkout', | |
templateUrl: './subscription-checkout.component.html', | |
styleUrls: ['./subscription-checkout.component.scss'] | |
}) | |
export class SubscriptionCheckoutComponent implements OnInit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Returns all topic information and returns it to the client. | |
/// If the user is not a paid member, the video urls and document urls are returned null. | |
/// </summary> | |
public async Task<TopicModel> GetTopicClassroomModelAsync(string topicId, string userId) | |
{ | |
// Get the topic entity | |
var topic = await _db.Topics | |
.Include(t => t.Lesson) // To get to the UserCourse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* With help of this class, we reduce the retrofit api call to a single line. | |
* Example: MyApiContainer.api().getMethod().enqueue(...); | |
*/ | |
public class MyApiContainer { | |
interface MyApi { | |
@GET("someEndpoint") | |
Call<String> getMethod(); | |