Skip to content

Commit

Permalink
Update Pools Query to Action (#1274)
Browse files Browse the repository at this point in the history
* update-data

* Update Pool fetching to action
  • Loading branch information
JeremyParish69 authored Mar 24, 2024
1 parent 9fdb827 commit b053822
Show file tree
Hide file tree
Showing 10 changed files with 355 additions and 139 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/query_pools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on: [workflow_dispatch]
name: Update Chain Registry
jobs:
update_chain_registry:
name: Update Chain Registry
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:

- name: Checkout repository
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
submodules: true

- name: Git Sumbodule Update
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19.6.0

- name: Run code to Query Pools
working-directory: ./.github/workflows/utility
run: node queryPools.mjs

- name: Add Commit Push
uses: devops-infra/action-commit-push@master
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
add_timestamp: false
commit_prefix: "[AUTO]"
commit_message: "Query and Save Pools"
force: false
target_branch: update/query_pools

- name: Create A PR
uses: devops-infra/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: update/query_pools
target_branch: main
title: Query and Save Pools
body: "**Automated pull request**"
old_string: "**THIS IS AN AUTOMATED UPDATE OF ALL POOLS**"
new_string: "** Automatic pull request**"
get_diff: true
ignore_users: "dependabot"
1 change: 0 additions & 1 deletion .github/workflows/utility/generate_assetlist_new.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//-- Imports --

import * as chain_reg from "../../../chain-registry/.github/workflows/utility/chain_registry.mjs";
//import * as chain_reg from "./chain_registry.mjs";
import * as zone from "./assetlist_functions.mjs";
import { getAssetsPricing } from "./getPools.mjs";
import { getAllRelatedAssets } from "./getRelatedAssets.mjs";
Expand Down
31 changes: 19 additions & 12 deletions .github/workflows/utility/getPools.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import * as zone from './assetlist_functions.mjs';

//-- Globals --

const poolsFileName = "all-pools.json";

let pools = new Map();
export let assets = new Map();
let usd, osmo, atom;
Expand Down Expand Up @@ -73,25 +75,23 @@ async function queryPools(domain) {

//--QUERY API--

console.log(domain);

let baseUrl = get_base_url(domain);
let params;
let fileName = "all-pools.json";

console.log(domain);
//console.log(baseUrl);
const fileName = poolsFileName;

queryApi.queryAPI(baseUrl, params, domain, fileName);

let storedResult = queryApi.readQueryResponse(domain, fileName);
if (!storedResult?.pools) { return; }
getPools(storedResult.pools);

}

function getPools(all_pools) {
function getPools(domain) {

let all_pools = queryApi.readQueryResponse(domain, poolsFileName);
if (!all_pools?.pools) { return; }

pools.clear();
all_pools.forEach((pool) => {
all_pools.pools.forEach((pool) => {
pools.set(pool.id,Pool(pool));
});

Expand Down Expand Up @@ -409,15 +409,22 @@ function getLargestRoute(routes, i){



export async function getAssetsPricing(chain){
export async function getAssetsPricing(chain) {
getAssets(chain);
await queryPools(chain);
//await queryPools(chain);
getPools(chain);
if (pools.size == 0) { return; }
getRoutes();
console.log(ticks);
return assets;
}

export async function queryAllPools() {
zone.chainNames.forEach(async (chainName) => {
await queryPools(chainName);
});
}

async function main() {
let domain = "osmosis";
//let domain = "osmosistestnet4";
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/utility/queryPools.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { queryAllPools } from './getPools.mjs';

queryAllPools();
2 changes: 1 addition & 1 deletion chain-registry
Submodule chain-registry updated 53 files
+4 −1 .github/workflows/utility/chain_registry.mjs
+18 −1 .github/workflows/utility/chain_registry_local.mjs
+142 −0 .github/workflows/utility/validate_data.mjs
+21 −21 .github/workflows/validate_data.yml
+29 −0 _non-cosmos/ethereum/assetlist.json
+ _non-cosmos/ethereum/images/beast.png
+34 −0 akiro/assetlist.json
+123 −0 akiro/chain.json
+ akiro/images/akiro.png
+67 −0 akiro/images/akiro.svg
+2 −2 bitcanna/chain.json
+29 −1 chihuahua/assetlist.json
+ chihuahua/images/bhuahua.png
+13 −0 cifer/chain.json
+6 −1 dymension/chain.json
+1 −1 highbury/assetlist.json
+4 −0 ibc_data.schema.json
+30 −2 juno/assetlist.json
+ juno/images/bJUNO-bbl.png
+26 −1 kujira/assetlist.json
+ kujira/images/bKUJI.png
+9 −10 migaloo/assetlist.json
+ migaloo/images/bWHALE.png
+0 −32 migaloo/images/bWHALE.svg
+27 −1 osmosis/assetlist.json
+20 −325 osmosis/chain.json
+ osmosis/images/bOSMO.png
+198 −1 osmosis/versions.json
+6 −2 scorum/assetlist.json
+6 −4 sei/assetlist.json
+9 −1 source/chain.json
+7 −4 teritori/assetlist.json
+3 −3 terra/assetlist.json
+14 −14 terra2/assetlist.json
+10 −8 terra2/chain.json
+ terra2/images/bLUNA.png
+ terra2/images/boneluna.png
+31 −0 testnets/_IBC/kujiratestnet-terra2testnet.json
+4 −0 testnets/arkeonetworktestnet/assetlist.json
+1 −1 testnets/babylontestnet/assetlist.json
+1 −1 testnets/babylontestnet1/assetlist.json
+1 −1 testnets/entrypointtestnet/assetlist.json
+1 −1 testnets/fetchhubtestnet/assetlist.json
+1 −1 testnets/lavatestnet/chain.json
+1 −1 testnets/permtestnet/chain.json
+2 −2 testnets/quasartestnet/assetlist.json
+1 −1 testnets/ulastestnet/assetlist.json
+1 −1 testnets/uniontestnet/assetlist.json
+18 −1 testnets/uniontestnet/chain.json
+1 −1 testnets/wavehashtestnet/chain.json
+1 −1 testnets/xiontestnet/assetlist.json
+29 −5 ununifi/chain.json
+3 −0 versions.schema.json
7 changes: 4 additions & 3 deletions osmo-test-5/generated/frontend/chainlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"chainSuggestionDenom": "ibc/28EEF762052DB8C3D27A7BF625E9F86A1B3B689CC8D80C818CEDF2EB6CBA02A6",
"coinMinimalDenom": "ibc/28EEF762052DB8C3D27A7BF625E9F86A1B3B689CC8D80C818CEDF2EB6CBA02A6",
"coinDecimals": 18,
"coinGeckoId": "tokenize-xchange",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/testnets/titantestnet/images/tkx.png"
},
{
Expand Down Expand Up @@ -1043,8 +1044,8 @@
},
{
"coinDenom": "OSMO",
"chainSuggestionDenom": "ibc/6AE2756AA7EAA8FA06E11472EA05CA681BD8D3FBC1AAA9F06C79D1EC1C90DC9B",
"sourceDenom": "ibc/6AE2756AA7EAA8FA06E11472EA05CA681BD8D3FBC1AAA9F06C79D1EC1C90DC9B",
"chainSuggestionDenom": "ibc/92E0120F15D037353CFB73C14651FC8930ADC05B93100FD7754D3A689E53B333",
"sourceDenom": "ibc/92E0120F15D037353CFB73C14651FC8930ADC05B93100FD7754D3A689E53B333",
"coinDecimals": 6,
"coinGeckoId": "osmosis",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/osmo.png"
Expand All @@ -1063,7 +1064,7 @@
"sourceDenom": "ibc/0166AE2224341A3F70943E315DAC6EDF012A638D0F9358794FF7525BA1DFC191",
"coinDecimals": 18,
"coinGeckoId": "injective-protocol",
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/injective/images/inj.svg"
"coinImageUrl": "https://raw.githubusercontent.com/cosmos/chain-registry/master/injective/images/inj.png"
}
],
"apis": {
Expand Down
91 changes: 81 additions & 10 deletions osmosis-1/generated/chain_registry/assetlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -12025,7 +12025,7 @@
"description": "The Revenue & Governance token of Unstake.fi",
"denom_units": [
{
"denom": "ibc/690EB0A0CA0DA2DC1E9CF62FB23C935AE5C7E9F57919CF89690521D5D70948A7",
"denom": "ibc/F74225B0AFD2F675AF56E9BE3F235486BCDE5C5E09AA88A97AFD2E052ABFE04C",
"exponent": 0,
"aliases": [
"factory/kujira1aaudpfr9y23lt9d45hrmskphpdfaq9ajxd3ukh/unstk"
Expand All @@ -12037,7 +12037,7 @@
}
],
"type_asset": "ics20",
"base": "ibc/690EB0A0CA0DA2DC1E9CF62FB23C935AE5C7E9F57919CF89690521D5D70948A7",
"base": "ibc/F74225B0AFD2F675AF56E9BE3F235486BCDE5C5E09AA88A97AFD2E052ABFE04C",
"name": "Unstake Fi",
"display": "nstk",
"symbol": "NSTK",
Expand Down Expand Up @@ -14836,13 +14836,13 @@
]
},
{
"description": "The Original Meme Coin on SEI Network",
"description": "The Original Meme Coin of SEI Network",
"denom_units": [
{
"denom": "ibc/B61F272C20D301DD6D0C036BDCDF8CD83A95EE594FBDD9977910AE69F58936D3",
"denom": "ibc/86074B8DF625A75C25D52FA6112E3FD5446BA41FE418880C168CA99D10E22F05",
"exponent": 0,
"aliases": [
"sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed"
"cw20:sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed"
]
},
{
Expand All @@ -14851,21 +14851,23 @@
}
],
"type_asset": "ics20",
"base": "ibc/B61F272C20D301DD6D0C036BDCDF8CD83A95EE594FBDD9977910AE69F58936D3",
"base": "ibc/86074B8DF625A75C25D52FA6112E3FD5446BA41FE418880C168CA99D10E22F05",
"name": "SEIYAN",
"display": "SEIYAN",
"symbol": "SEIYAN",
"traces": [
{
"type": "ibc",
"type": "ibc-cw20",
"counterparty": {
"chain_name": "sei",
"base_denom": "sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed",
"base_denom": "cw20:sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed",
"port": "transfer",
"channel_id": "channel-0"
},
"chain": {
"port": "transfer",
"channel_id": "channel-782",
"path": "transfer/channel-782/sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed"
"path": "transfer/channel-782/cw20:sei1hrndqntlvtmx2kepr0zsfgr7nzjptcc72cr4ppk4yav58vvy7v3s4er8ed"
}
}
],
Expand All @@ -14881,6 +14883,49 @@
"osmosis-unlisted"
]
},
{
"description": "The Revenue & Governance token of Unstake.fi",
"denom_units": [
{
"denom": "ibc/690EB0A0CA0DA2DC1E9CF62FB23C935AE5C7E9F57919CF89690521D5D70948A7",
"exponent": 0,
"aliases": [
"factory/kujira1aaudpfr9y23lt9d45hrmskphpdfaq9ajxd3ukh/unstk"
]
},
{
"denom": "nstk",
"exponent": 6
}
],
"type_asset": "ics20",
"base": "ibc/690EB0A0CA0DA2DC1E9CF62FB23C935AE5C7E9F57919CF89690521D5D70948A7",
"name": "Unstake Fi",
"display": "nstk",
"symbol": "NSTK",
"traces": [
{
"type": "ibc",
"counterparty": {
"chain_name": "kujira",
"base_denom": "factory/kujira1aaudpfr9y23lt9d45hrmskphpdfaq9ajxd3ukh/unstk",
"channel_id": "channel-3"
},
"chain": {
"channel_id": "channel-259",
"path": "transfer/channel-259/factory:kujira1aaudpfr9y23lt9d45hrmskphpdfaq9ajxd3ukh:unstk"
}
}
],
"logo_URIs": {
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/kujira/images/nstk.svg"
},
"images": [
{
"svg": "https://raw.githubusercontent.com/cosmos/chain-registry/master/kujira/images/nstk.svg"
}
]
},
{
"denom_units": [
{
Expand Down Expand Up @@ -14943,7 +14988,7 @@
"type_asset": "ics20",
"base": "ibc/F49DFB3BC8105C57EE7F17EC2402438825B31212CFDD81681EB87911E934F32C",
"name": "Nomic",
"display": "nomic",
"display": "nom",
"symbol": "nomic.NOM",
"traces": [
{
Expand Down Expand Up @@ -15027,6 +15072,32 @@
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/toro.png"
}
]
},
{
"description": "BackBone Labs Liquid Staked OSMO",
"denom_units": [
{
"denom": "factory/osmo1s3l0lcqc7tu0vpj6wdjz9wqpxv8nk6eraevje4fuwkyjnwuy82qsx3lduv/boneOsmo",
"exponent": 0
},
{
"denom": "bOSMO",
"exponent": 6
}
],
"address": "osmo1s3l0lcqc7tu0vpj6wdjz9wqpxv8nk6eraevje4fuwkyjnwuy82qsx3lduv",
"base": "factory/osmo1s3l0lcqc7tu0vpj6wdjz9wqpxv8nk6eraevje4fuwkyjnwuy82qsx3lduv/boneOsmo",
"name": "BackBone Labs Liquid Staked OSMO",
"display": "bOSMO",
"symbol": "bOSMO",
"logo_URIs": {
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/bOSMO.png"
},
"images": [
{
"png": "https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/bOSMO.png"
}
]
}
]
}
Loading

0 comments on commit b053822

Please sign in to comment.