Skip to content

Instantly share code, notes, and snippets.

View shanev's full-sized avatar
💭
#BUIDL

shane.stars shanev

💭
#BUIDL
View GitHub Profile

A Tale of Two Name Services

Problem

The name alice can exist on multiple chains, owned by different accounts.

For example, alice.stars can point to a stars address that is associated with a different key than alice.stars on ICNS.

Solution 1: Merge ICNS and Stargaze Names

params.trading_fee_percent = trading_fee_bps
.map(Decimal::percent)
.unwrap_or(params.trading_fee_percent);
params.ask_expiry = ask_expiry.unwrap_or(params.ask_expiry);
params.bid_expiry = bid_expiry.unwrap_or(params.bid_expiry);
/*
* Wraps a cw721 contract with helpers.
* Adapted from https://github.com/CosmWasm/cw-plus/blob/main/contracts/cw721-base/helpers.ts.
*/
import {
CosmWasmClient,
SigningCosmWasmClient,
} from '@cosmjs/cosmwasm-stargate';
import { coins } from '@cosmjs/stargate';
@shanev
shanev / tmux_cheat.txt
Last active July 22, 2021 15:54
tmux cheat
# start
tmux
# should see green bar at bottom
tmux list-sessions
tmux attach -t0
# detach current session
# Ctrl + b, release, then d
" execute pathogen#infect()
syntax on
filetype plugin indent on
:imap jj <Esc>
" old tab settings...
" show existing tab with 4 spaces width
" set tabstop=4
" when indenting with '>', use 4 spaces width
{
"assets": [
{
"id": 16235724,
"token_id": "369690035",
"num_sales": 0,
"background_color": null,
"image_url": "https://storage.opensea.io/files/13feb7324c6162c6857e212efeb67dd0.svg",
"image_preview_url": "https://storage.opensea.io/files/13feb7324c6162c6857e212efeb67dd0.svg",
"image_thumbnail_url": "https://storage.opensea.io/files/13feb7324c6162c6857e212efeb67dd0.svg",
{
"app_hash": "",
"app_state": {
"auth": {
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.ModuleAccount",
"base_account": {
"account_number": "7",
"address": "stb1yl6hdjhmkf37639730gffanpzndzdpmhv50wq7",
msg := curating.NewMsgPost(c.VendorID, postID, creator, creator, body)
account, err := c.GetAccount(creator)
if err != nil {
return err
}
txBytes, err := c.TxBuilder.
WithAccountNumber(account.GetAccountNumber()).
WithSequence(account.GetSequence()).

Postgres Cheat Sheet

psql -h localhost -U postgres -d [db_name]

Disable word wrap PAGER="less -S" psql -h localhost -U postgres -d [db_name]

Connection

Show connection info \conninfo

@shanev
shanev / vim_cheat.md
Last active September 5, 2021 16:30
vim8 Cheat Sheet

VIM CHEAT SHEET

Navigation

Quit all :qa

Go to top of file :gg

Go to bottom of file Shift-g