Skip to content

Instantly share code, notes, and snippets.


Giancarlos Salas giansalex

View GitHub Profile
giansalex / keplr-suggest.js
Last active Jun 28, 2022
Evmos chain to keplr v0.9.13
View keplr-suggest.js
// Download and install keplr:
// Use developer console (Browser)
let chainInfo = {
"chainId": "evmos_9000-4",
"chainName": "Evmos Testnet",
"rpc": "",
"rest": "",
"stakeCurrency": {
"coinDenom": "EVMOS",
giansalex / 01-main.js
Last active Aug 7, 2022
Export Cosmwasm contract state.
View 01-main.js
const fs = require('fs');
// state.json -> GET /cosmwasm/wasm/v1/contract/{contract}/state
function main() {
const data = fs.readFileSync('cw721-state.json', 'utf8');
const state = JSON.parse(data);
const items = [];
state.models.forEach(m => {
giansalex /
Created Apr 21, 2022 — forked from webmaster128/
Sync Juno from genesis (April 7th, 2022)

Run juno node from genesis

Base installation

Tested on Ubuntu 20.04 but should be very similar for all Ubuntu/Debian systems. Logged in as root because I'm feeling lucky.

# Base installation
apt update && apt upgrade -y \
  && apt install -y joe git build-essential jq screen

Create collection

# args(2): name, symbol.
./build/gnokey maketx call test1 --pkgpath "" --func CreateCollection \
  --args "Disperze NFTs" \
  --args "DNFT" \
  --gas-fee 1gnot --gas-wanted 2000000 > create.unsigned.txt

./build/gnokey sign test1 --txpath create.unsigned.txt --chainid "testchain" --number $ACC_NUMBER --sequence $SEQUENCE > create.signed.txt
./build/gnokey broadcast create.signed.txt --remote
View sign-evmos-keplr.js
import { SigningStargateClient } from '@cosmjs/stargate'
import { fromBase64 } from "@cosmjs/encoding";
import {
} from '@cosmjs/proto-signing'
import { Int53, Uint53 } from "@cosmjs/math";
import { Any } from "cosmjs-types/google/protobuf/any";
import { PubKey } from "cosmjs-types/cosmos/crypto/secp256k1/keys";
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
giansalex / eth-sign.js
Last active Apr 21, 2022
Ethereum - Sign arbitrary data (sign cosmos tx bytes)
View eth-sign.js
var Web3 = require('web3');
var web3 = new Web3(window.web3.currentProvider);
var accountToSignWith = '0xbedcf417ff2752d996d2ade98b97a6f0bef4beb9';
var message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.'
function signHandler(err, signature) {
if (!err) {
console.log('Signature:', signature);
signature = signature.substr(2);
giansalex /
Last active Nov 29, 2021
Join to Juno UNI Testnet [state-sync]

Juno Cosmwasm state-sync

Build binary

git clone
cd Juno
git checkout v2.0.0-beta-sync.3
make build && make install
giansalex / listen-cw20-transfer.go
Last active Jun 24, 2022
Listen cw20 transactions (Cosmwasm v1)
View listen-cw20-transfer.go
package main
import (
rpchttp ""
giansalex /
Last active Aug 23, 2021
Join to JUNO chain testnet (lucina)

Join to Juno testnet

Initialize junod

junod init [moniker] --chain-id lucina

Configure junod

  • Download and replace the lucina Testnet genesis.json by:
giansalex / query-ruc-padron.php
Last active Apr 30, 2022
Query RUC list - SUNAT
View query-ruc-padron.php
// Descargar padron reducido:
// Resultado al descomprimir: padron_reducido_ruc.txt
function queryRucPadron($txtPath, $ruc)
$handle = fopen($txtPath, "r") or die("No se puede abrir el txt");