Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cosmoscontracts/junoswap-airdrop-helper
Set of toolings to simplify extracting data from JunoSwap Liquidity Pools and facilitate the creation of airdrops.
https://github.com/cosmoscontracts/junoswap-airdrop-helper
Last synced: 2 months ago
JSON representation
Set of toolings to simplify extracting data from JunoSwap Liquidity Pools and facilitate the creation of airdrops.
- Host: GitHub
- URL: https://github.com/cosmoscontracts/junoswap-airdrop-helper
- Owner: CosmosContracts
- Created: 2022-04-09T03:33:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-23T23:08:42.000Z (over 2 years ago)
- Last Synced: 2024-04-24T03:20:43.038Z (9 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JunoSwap Airdrop Helper
Set of toolings to simplify extracting data from JunoSwap Liquidity Pools and facilitate the creation of airdrops.
## Preparing snapshot
Data can be decoded from a state-export of any Cosmos Chain with CosmWasm module enabled and it has been tested on Juno. Since full state exports are ofter too large to be read easily from javascript we need to extract only the parts we need first. To do so you can use the follwing commands as an example
```
junod export --height 2500000 2> snap_2500000.json
cat snap_2500000.json | jq .app_state.wasm.contracts > 2500000_contracts.json
```Once you have contract state in an easy json format you can start using the scripts.
## Exctract token balance from JunoSwap
Command
```
npm run tokenInPool
```Example
```
npm run tokenInPool ./2500000_contracts.json juno18ckrreffz9jwmkw84axsvncexfqt7gpgckskk0yy0vzwm9huqkyq6v78xu juno1sg6chmktuhyj4lsrxrrdflem7gsnk4ejv6zkcc4d3vcqulzp55wsf4l4gl ujuno juno_atom.json
```Output (truncated)
```json
{
"total": 472385654736,
"balances": [
{
"address": "juno1000fwt3k6p3m55sdk0aeut4wmnhnpcus9zxddr",
"balance": 2679752,
"tokenInPool": 1819833.7270461952
},
{
"address": "juno1004hu5jffyaskl24a4rlxcrexl4zevlssgdx8p",
"balance": 374315,
"tokenInPool": 254199.29215065297
}
]
}
```