moving comsos address gen to it's own folder, and adding a readme

This commit is contained in:
gnomadic 2023-05-30 13:30:18 -04:00
parent 88e6c30a0d
commit 2c6aa70e3c
19 changed files with 38 additions and 40 deletions

View File

@ -0,0 +1,31 @@
# Cosmos Address Generator
## Setup
`npm install`
## Usage
1. Open `generateIBCAddress.js` and locate:
```
/*
*
* Set Filename here!
*
*/
const fileName = "test.csv";
```
(It's at the top of the file)
2. update the variable `fileName` to be the name of your CSV file.
3. Ensure the CSV file does not have `"` around each address, and each address is on a new line. Following CSV format, the first line of the file will be skipped so make sure there is a header line.
4. Run `node generateIBCAddress.js`
5. The output will be `addresses.json`

View File

@ -1,40 +1,14 @@
import * as fs from "fs";
const fileName = "test.csv";
// import { lookup } from "convert-bech32-address";
// var converter = import("./convert-bech32-address.js");
import pkg from "convert-bech32-address";
const { lookup } = pkg;
class Addresses {
constructor(
cosmos = "",
axelar = "",
osmo = "",
evmos = "",
inj = "",
stride = "",
juno = "",
secret = "",
stars = "",
umee = "",
agoric = "",
persistence = ""
) {
this.cosmos = cosmos;
this.axelar = axelar;
this.osmo = osmo;
this.evmos = evmos;
this.inj = inj;
this.stride = stride;
this.juno = juno;
this.secret = secret;
this.stars = stars;
this.umee = umee;
this.agoric = agoric;
this.persistence = persistence;
}
}
/*
*
* Set Filename here!
*
*/
const fileName = "test.csv";
const targets = [
"axelar",
@ -84,10 +58,3 @@ rows.map((row) => {
fs.writeFileSync("addresses.json", JSON.stringify(addresses, null, 2));
console.log(addresses);
// var newAddress = converter.lookup('cosmos1r5qkmvn9hnv0pugejr73639w07d2mughnm7qxa','juno');
// console.log(newAddress);
// return new Addresses(cosmos, axelar, osmo, evmos, inj, stride, juno, secret, stars, umee, agoric, persistence);
// }