Skip to content

Instantly share code, notes, and snippets.

var E=Object.defineProperty;var _=(a,o,d)=>o in a?E(a,o,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[o]=d;var u=(a,o,d)=>_(a,typeof o!="symbol"?o+"":o,d);(function(){"use strict";const m={mainnet:"http://localhost:3000"},I={mainnet:"https://rpc.mainnet.near.org"};function T(r){const e=new TextEncoder().encode(r);let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return btoa(t)}async function y(r,e,t){const s=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tx",params:{tx_hash:e,sender_account_id:t,wait_until:"NONE"}})})).json();if(s.error)throw new Error(s.error.message||JSON.stringify(s.error));return s.result}class A{constructor(e,t){u(this,"walletUrl");u(this,"signedAccountId");u(this,"network");this.walletUrl=e,this.signedAccountId=window.localStorage.getItem("trezu:signedAccountId")||"",this.network=t}getAccountId(){return this.signedAccountId}isSignedIn(){return!!this.signedAccountId}signOut(){this.sign
@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)]