Skip to content

Instantly share code, notes, and snippets.

View clockworkgr's full-sized avatar
🏠
Working...

Clockwork clockworkgr

🏠
Working...
View GitHub Profile

Task description:

Assume you have the following files:

query1.ts

type Args = {
 arg1: number,
 arg2: string
export default function useCosmosBankV1Beta1() {
const client = useClient();
const QueryBalance = (address: string, query: any, options: any) => {
const key = { type: "QueryBalance", address, query };
return useQuery(
[key],
() => {
const { address, query } = key;
return client.CosmosBankV1Beta1.query.queryBalance(address, query ?? undefined).then((res) => res.data);
@clockworkgr
clockworkgr / gist:03118ea2fa983468465b4d786e790bb5
Created October 16, 2020 08:45
Primitive types and functions
In use:
uint8
uint16
uint32
uint64
int64
varint32
varuint64
time_point_sec => (uint32 timestamp)
ChainTypes.operations = {
transfer: 0,
order_create: 1,
order_cancel: 2,
order_update: 3,
account_create: 4,
account_update: 5,
account_whitelist: 6,
account_transfer: 7,
asset_create: 8,
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8090 });
var front=[];
var back=[];
var conn_id=0;
var incount=[];
var backcount=[];
var calls={};
import WebSocket from "ws";
class Pinger {
constructor(timeout, frequency) {
this.url = {};
this.urls = [];
this.timeout = timeout;
this.frequency = frequency;
let self = this;
@clockworkgr
clockworkgr / beet-js.js
Last active February 6, 2019 22:34
Beet-JS wrappers
const OTPAuth = require('otpauth');
import CryptoJS from "crypto-js";
import browser from 'browser-detect';
import BeetClientDB from './lib/BeetClientDB';
import "isomorphic-fetch";
import { ec as EC } from "elliptic";
var ec = new EC('curve25519');
class BeetJS{
@clockworkgr
clockworkgr / proposal.txt
Created December 17, 2018 11:40
Current to proposed fee comparison.
price_per_kbyte price for transfer differs by 10.134x (network: 0.0030 USD / proposal: 0.0300 USD)
fee price for transfer differs by 15.013x (network: 0.0053 USD / proposal: 0.0800 USD)
fee price for limit_order_create differs by 33.832x (network: 0.0003 USD / proposal: 0.0100 USD)
fee price for limit_order_cancel differs by 34.307x (network: 0.0000 USD / proposal: 0.0010 USD)
fee price for call_order_update differs by 33.832x (network: 0.0003 USD / proposal: 0.0100 USD)
price_per_kbyte price for account_create differs by 14.478x (network: 0.0021 USD / proposal: 0.0300 USD)
basic_fee price for account_create differs by 8.445x (network: 0.0296 USD / proposal:

Keybase proof

I hereby claim:

  • I am clockworkgr on github.
  • I am clockworkgr (https://keybase.io/clockworkgr) on keybase.
  • I have a public key ASCCQZ5fkhLDrTofcL7-2fO0gJA7hBKkXl9skFywMowX8Qo

To claim this, I am signing this object: