Skip to content

Instantly share code, notes, and snippets.

@frol
frol / README.md
Created February 7, 2023 17:05
MNW Transition Evaluation Criteria Matrix

image

{
"openapi": "3.0.0",
"info": {
"title": "NEAR Enchanced API (by Pagoda Inc)",
"version": "0.1"
},
"servers": [{
"url": "https://near-enhanced-api-mainnet.fly.dev/"
}],
"paths": {
{"swagger":"2.0","definitions":{"BalancesResponse":{"type":"object","properties":{"balances":{"type":"array","items":{"type":"object","properties":{"balance":{"type":"string"},"contract_account_id":{"type":"string"},"metadata":{"type":"object","properties":{"decimals":{"type":"integer","format":"int32"},"icon":{"type":"string"},"name":{"type":"string"},"symbol":{"type":"string"}},"required":["decimals","name","symbol"]},"standard":{"type":"string"}},"required":["balance","metadata","standard"]}},"block_height":{"type":"string"},"block_timestamp_nanos":{"type":"string"}},"required":["balances","block_height","block_timestamp_nanos"]},"FtMetadataResponse":{"type":"object","properties":{"block_height":{"type":"string"},"block_timestamp_nanos":{"type":"string"},"metadata":{"type":"object","properties":{"decimals":{"type":"integer","format":"int32"},"icon":{"type":"string"},"name":{"type":"string"},"reference":{"type":"string"},"reference_hash":{"type":"string"},"spec":{"type":"string"},"symbol":{"type":"string"}}
@frol
frol / AccountChangesFlow.tsx
Created September 25, 2021 19:06
Live Transactions visualization on NEAR mainnet
// https://youtu.be/2WXaosLThBY
import React, { useState, useEffect } from "react";
import ReactEcharts from "echarts-for-react";
import echarts from "echarts";
import { Tabs, Tab } from "react-bootstrap";
import StatsApi, { AccountsByDate } from "../../libraries/explorer-wamp/stats";
import { Props } from "./TransactionsByDate";

Keybase proof

I hereby claim:

  • I am frol on github.
  • I am frolvlad (https://keybase.io/frolvlad) on keybase.
  • I have a public key whose fingerprint is 88F7 06C1 6FC6 C675 B90D DE40 BAD8 9512 3D14 D770

To claim this, I am signing this object:

@frol
frol / main.ts
Created September 22, 2019 12:38
Example of a chained smart-contracts in NEAR
import { context, storage, logging, ContractPromise, util } from "near-runtime-ts";
export class AddArgs {
a: i32;
b: i32;
};
export class MultiplyByArgs {
x: i32;
};
$ ./scripts/start_localnet.py
****************************************************
* Running NEAR validator node for Local TestNet *
****************************************************
Using default tag: latest
latest: Pulling from nearprotocol/nearcore
c64513b74145: Pull complete
01b8b12bad90: Pull complete
c5d85cf7a05f: Pull complete
@frol
frol / qq.sql
Created June 17, 2019 17:19
DOTS queries
SELECT COUNT(*) FROM dots.`2018_users`;
SELECT COUNT(*) FROM dots.`2018_problems`;
SELECT COUNT(*) FROM dots.`2018_solutions`;
SELECT COUNT(*) FROM dots.`2018_messages`;
SELECT * FROM dots.`2018_problems` WHERE complexity > 1;
@frol
frol / habr-swift-vs-rust.rs
Created May 6, 2019 14:25
My refactored version of Rust implementation to the article "Swift против Rust — бенчмаркинг на Linux с (не)понятным финалом" https://habr.com/en/post/450512/
//[dependencies]
//serde_json = "1.0"
use serde_json::Value;
use std::collections::{HashMap, HashSet};
const FILE_BUFFER_SIZE: usize = 50000;
//source data
#[derive(Default)]
//! https://leetcode.com/problems/container-with-most-water/
//!
//! Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i,
//! ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0).
//! Find two lines, which together with x-axis forms a container, such that the container contains
//! the most water.
//!
//! Note: You may not slant the container and n is at least 2.
fn max_area_brute_force(height: Vec<i32>) -> i32 {