Giter Site home page Giter Site logo

cosmology's People

Contributors

aidanaden avatar alexanderclarktx avatar dependabot[bot] avatar njerschow avatar pyramation avatar solumos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cosmology's Issues

bug: `makePoolsPretty` is not a function in production build

image

Hi! am currently receiving this error message in production build, but i'm still not sure what the issue is, everything works fine locally.

Node version used is 14.19.2, built with vite 2.8.6

Package.json:

"@cosmjs/proto-signing": "^0.29.0",
"@cosmology/core": "^1.8.0",

Thanks a bunch!

TypeError: routes.map is not a function

const routes = {
"poolId": "1",
"tokenOutDenom": "uosmo"
}

const msg = swapExactAmountIn({
sender: '',
routes,
tokenIn: coin(1000, 'uosmo'),
tokenOutMinAmount: 10000
});

I using something right this and get an error routes.map,when I try to use lookupRoutesForTrade,but I dont know what exactly the beliefValue and pair?

mobx store

This issue is more for design and listing out queries that are needed.

  • all basic like ability to get users balances
  • ability to get users number of tokens inside of a pool

e.g. currently do get number of tokens in a pool

  1. get pools
  2. get prices
  3. convertPoolsToDisplayValues
  4. get the users locked coins
  5. call function getUserPools({pools, lockedPools})

instead, if we used a mobx store, we could wrap this all into a single call and it gets cached and we get simplicity and speed

DEPRECATING this repo — use `osmojs`, `@osmonauts/math` and `chain-registry` instead

Hi! Cosmology/core is becoming deprecated soon, as the asset list is "baked in" and the code is legacy.

An ideal workflow is to use osmojs and @osmonauts/math, which we have examples as shown here and in a video/tweet here

then you can use the chain-registry for loading assets, and you can use @chain-registry/osmosis for pre-baked assets, or @chain-registry/utils to build an asset list dynamically:

import { ibc, assets } from 'chain-registry';
import { getAssetLists } from '@chain-registry/utils';

const list = getAssetLists('osmosis', ibc, assets);

getPoolsPricesPairs error - unknown pool type

Whe I run the getPoolsPricesPairs function :

this.client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint: 'https://rpc.osmosis.zone'});
const {
    pools,
    prices,
    pairs
} = await getPoolsPricesPairs(this.client);

I receive this error :
Uncaught Error Error: unknown pool type
at (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@cosmology/core/main/utils/osmo/pools.js:87:25)
at _callee$ (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@cosmology/core/main/utils/osmo/pools.js:76:39)
at tryCatch (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:44:17)
at (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:125:22)
at (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@babel/runtime/helpers/regeneratorRuntime.js:69:21)
at asyncGeneratorStep (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/home/herraiz/dev/cosmos-osmosis-fetcher/node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)
at processTicksAndRejections (internal/process/task_queues:95:5)

Issue swapping

Getting an error trying to swap on testnet

TypeError: Cannot read properties of undefined (reading 'amount')
    at _callee$ (/Users/joel/.nvm/versions/node/v16.14.0/lib/node_modules/cosmology/node_modules/@cosmology/cli/main/commands/swap.js:153:83)
cosmology swap \
	--mnemonic "pass panther local rare exit rule robust feel excuse hold arrange fence" \
	--chainId osmo-test-4 \
	--restEndpoint "https://lcd-test.osmosis.zone" \
	--rpcEndpoint "https://rpc-test.osmosis.zone" \
	--sell osmo \
	--buy atom \
	--value 1 \
	--slippage 1

I am using rest/rpc endpoints from here, is this correct?

increase pagination limit for OsmosisApiClient's getPools request

The osmosis frontend currently queries the endpoint https://lcd-osmosis.keplr.app/osmosis/gamm/v1beta1/pools?pagination.limit=1000 with pagination set to 1000 when getting the pool data from the LCD, however the OsmosisApiClient.getPools function continues to query with pagination set to 750, causing a few pools with IDs greater than 750 to be missed out.

upgrade cosmjs

when attempting to upgrading cosmjs libraries to 0.28.1, typeUrl is apparently not recognized

{
  "typeUrl": "/osmosis.gamm.v1beta1.MsgSwapExactAmountIn",
  "value": {
    "sender": "osmo1REDACTED",
    "routes": [
      {
        "poolId": "4",
        "tokenOutDenom": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"
      }
    ],
    "tokenIn": {
      "denom": "ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4",
      "amount": "3546099"
    },
    "tokenOutMinAmount": "160609"
  }
}
/Users/pyramation/code/cosmology/cosmology/node_modules/@cosmjs/stargate/build/aminotypes.js:21
            throw new Error(`Type URL '${typeUrl}' does not exist in the Amino message type register. ` +
                  ^

Error: Type URL '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.
    at AminoTypes.toAmino (/Users/pyramation/code/cosmology/cosmology/node_modules/@cosmjs/stargate/src/aminotypes.ts:43:13)
    at /Users/pyramation/code/cosmology/cosmology/node_modules/@cosmjs/stargate/src/signingstargateclient.ts:347:56
    at Array.map (<anonymous>)
    at SigningStargateClient.signAmino (/Users/pyramation/code/cosmology/cosmology/node_modules/@cosmjs/stargate/src/signingstargateclient.ts:347:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Unexpected encoding result

Hello!
I do swapExactAmountIn osmosis message. And usually it's working perfect.
But sometimes, for example in DAI/OSMO pool i encode message with parameter:

tokenIn: {
  "denom": "ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7",
  "amount": "129433920747610326239"
}

But after in osmosis scan in logs I see this:
https://www.mintscan.io/osmosis/txs/C67C13B32A51CBCD6763CA515DDCABD1523281A849D0C445CFF4A8FC5DEE5E52

"token_in":{
"denom":string"ibc/0CD3A0285E1341859B5E86B6AB7682F023D03E97607CCC1DC95706411D866DF7"
"amount":string"306712231643464927"
}

I cannot understand how the 129433920747610326239 become 306712231643464927.
Please, help!

can't import { messages } from '@cosmology/core';

when i run , it showed :
SyntaxError: Named export 'messages' not found. The requested module '@cosmology/core' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@cosmology/core';
const { messages } = pkg;

Old assetlist.json with missing tokens

The current assetlist.json has not been updated for 2 months or so, hence there are various new tokens added by osmosis that is missing. The existing assetlist.json url is also invalid and returns a 404.

Method getPools returns wrong LcdPool[] properties

Hi,
I got LcdPool[] by doing :

  • Make a client by instancing OsmosisApiClient
  • Call getPools(). Get a PoolsResponse containing LcdPool[]

The issue is that the received LcdPool[] have properties like pool_assets and not poolAssets. Same for total_weight and pool_params.
So, I have to "clean" my LcdPool[] before using it. With, for example if (pool.pool_params) pool.poolParams = pool.pool_params

Here is LcdPool : https://github.com/cosmology-tech/cosmology/blob/main/packages/core/src/types.ts#L284
Here is PoolsResponse : https://github.com/cosmology-tech/cosmology/blob/main/packages/core/src/clients/osmosis.ts#L21
Here is the method getPools() of OsmosisApiClient : https://github.com/cosmology-tech/cosmology/blob/main/packages/core/src/clients/osmosis.ts#L33

Wdyt ?
Thank you for your repo and your time.

swap error while the same swap work in web app

use this cmd to swap

cosmology swap \
    --chainId osmosis-1 \
    --restEndpoint https://lcd-osmosis.blockapsis.com/ \
    --rpcEndpoint https://osmosis.validator.network/ \
    --sell UST \
    --buy ATOM \
    --value 0.1 \
    --slippage 1  

TX failed:
failed to execute message; message index: 0: ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 token is lesser than min amount: calculated amount is lesser than min amount
TX: https://www.mintscan.io/osmosis/txs/F08A98B4F7932CDB3722FADF924B321A8FE0F34589485E40ADB513D7F70378A2

while the same swap succ at app, also using this cmd to swap atom/osmo succ, but swap ust would occur this error

Update pools query pagination limit to 2000

The current pagination limit when querying for osmosis pools is 1000, with the total number of pools currently at 925 (verify here).

To deal with the growing number of pools, pagination limit should be increased to 1500 to ensure all pools are queried.

PS. would be very helpful if anyone knows of a way to query the pools endpoint such that all pools are returned WITHOUT having to set the pagination.limit query parameter (so we don't have to update this again)

CoinGecko API response error: AxiosError: connect ETIMEDOUT 162.125.6.1:443

const rpcEndpoint = "https://rpc.cosmos.directory/osmosis"
const client = await osmosis.ClientFactory.createRPCQueryClient({ rpcEndpoint });

const {
pools,
prices,
pairs,
prettyPools
} = await getPoolsPricesPairs(client);

CoinGecko API response error: AxiosError: connect ETIMEDOUT 162.125.6.1:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1157:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
port: 443,
address: '162.125.6.1',
syscall: 'connect',
code: 'ETIMEDOUT',
errno: -4039,

Is there something wrong with my network ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.