Giter VIP home page Giter VIP logo

lib's People

Contributors

0xairdropfarmer avatar 0xapotheosis avatar 0xdef1cafe avatar 0xean avatar amitojsingh366 avatar asamere avatar bootsboogie avatar chxash avatar cjthompson avatar daodev44 avatar dependabot[bot] avatar elmutt avatar firebomb1 avatar gmsteuart avatar gomesalexandre avatar kaladinlight avatar majorhayes avatar mrnerdhair avatar pastaghost avatar reallybeard avatar sdmg15 avatar semantic-release-bot avatar stackedq avatar sterl avatar technojak avatar theoboldfrazier avatar thesmithdao avatar toshisat avatar vividwood avatar willyogo avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lib's Issues

Swapper in Lib: implement GetBestQuote

Once Thorchain is added, choose best quote given a set of assets.

Note: getQuote can be expensive. This may need to only happen when assets are changed. This actually probably should be getBestSwapper. More discussion is needed when we get here

Market service getByMarketCap

We need a way to get market cap data, so we can sort assets in the UI (and display market cap obv).

Use coingecko API to get this, cache the calls, and generate static data and commit to github (like we do in the asset service) as a fallback for when clients inevitably get rate limited.

Add default path to chain adapters

when we get an address from chain adapters, we currently need to specify a path

const address = await chainAdapter.getAddress({ wallet, path: "m/44'/60'/0'/0/0" })

most times this is the same default path. make the path a default param with the value above, and make it overridable


this is being captured in the bitcoin chain adapters branch

Add error handling to 0x Trade

We are currently not showing any feedback to the user for basic trade errors, (ie: input value is less than min trade amount). We need to add some basic error handling for these states:

  • User tries to trade an amount that is less than the minimum trade amount.
  • User tries to trade more than their balance of that asset.
  • User tries to trade, but their ETH balance does not cover the txFee.

Bitcoin chain-adapters

Copy the spec for ethereum and write all the functions needed by the interface but for BTC.

Create lib utils package

There are going to be a few utility type functions that we want to share between packages in lib.

We don't want to define these within each package and they should live happily together.

Create a utils package within lib to host shared functions.

Align package.json versions and npm version in lib

I yolo'd the package version higher to get semantic release to publish.

It published based on the actually "semantic" versions it should.

Go back and change all the package.json versions to match the latest tag published on npm.

Remove commitlint

This was way more agro than I anticipated. I'd hoped it would only lint the merge commit message to main and develop, not every commit on a branch going into them.

It doesn't seem configurable to allow this behavior.

For discussion

pros

  • extremely tidy commit messages
  • enables automatic releases conforming to semantic versioning based on types of commits
  • enables automatically generated changelogs
  • can ignore merge commits, so we can merge develop into a PR to ensure it's up to date

cons

  • requires all commits on a PR branch to confirm to the spec, or branches to be rebased/squashed to a single commit before PRing (not necessarily a bad thing)
  • adds additional friction for new contributors
  • may not be able to use github's super handy commit suggestion feature (TBD)

Asset service

  • Service to return supported asset list
  • Return in format of current asset db layout.
  • Start with getFullList() but make it generic enough to extend later.
  • Unique identifier per asset should be same format that mikep came up with!

Create lib types package

We already have a few shared types and enums between packages. These should belong in a shared/common package and will avoid circular dependencies in future.

Create a types package within lib and move things like ChainType NetworkType or Asset in there and fix in the imports in the other package.

Refactor BitcoinChainAdapter to UTXOChainAdapter

Background

Chain adapters are an abstraction layer that our applications use to hide chain specific functionality. Currently we have implemented a BitcoinChainAdapter that should be able to be made generic enough to be turned into a UTXOChainAdapter that supports all UTXO base chains (LTC, DOGE, etc)

This will require some modifications to inject chain specific dependencies via the constructor, and it's internal functionality. This will allow us to support many utxo chains in the future by instantiating a new instance of the adapter with appropriate constructor arguments.

Acceptance Criteria

  • refactor the BitcoinChainAdapter to AbstractUTXOChainAdapter
  • create concrete classes for BitcoinChainAdapter and DogecoinChainAdapter
  • getType() should return the UTXO ChainType that is based on the arguments passed into the constructor.
  • getCaip2() should return correct caip2 based on the UTXO passed into the constructor
  • getAccount() returns a more generic promise type with a correct chain in the return object
  • getTxHistory() returns a more generic promise type with a correct chain in the return object
  • use slip44 coin types from the spec https://github.com/satoshilabs/slips/blob/master/slip-0044.md
  • Add / modify unit tests for the new generic adapter
  • Search for anywhere we are creating this chain adapter in a hard coded fashion would need to be updated.

See #289 as a reference to how this is being done for Cosmos.

Bounty Hunters

  • This issue may take a bit of exploring to understand how this can be refactored in a generic fashion and the bounty amount hopefully reflects some time spent on that.
  • Please refer to this link for some basic info
  • Join our discord here
  • Please include an expected timeline for you to complete work in the work plan when you apply for this bounty!

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.