smartcontractkit / chainlink

node of the decentralized oracle network, bridging on and off-chain computation
https://chain.link
Other
6.98k stars 1.7k forks source link

[FEAT] TOML String conversion task needed (APIs are case sensitive) #5536

Closed Tobias35 closed 2 years ago

Tobias35 commented 2 years ago

Description While working on a new TOML job to replace our external adapter we reconised a problem calling APIs with the built in http. In the toml it is not possible to manipulate case sensitivity. Which makes it impossible for the smartcontract to make an uniform call to the job. Since Exchanges and API suppliers deal with this matter in different ways it is crucial to manipulate the data inside a toml job.

Motivation APIs are case sensitive ie. HUOBI takes pairs in lowercase while BINANCE for example uses uppercase pairs. BTC/USD != btc/usd

Justification TOML ie:

quote_toLower [type="lowercase" input="$(decode_cbor.from)"] # input BTC -> btc base_toLower [type="lowercase" input="$(decode_cbor.to)"] # input USD -> usd

huobi [type="http" method=GET url="https://api.huobi.pro/market/trade?symbol=$(quote_toLower)$(base_toLower)t"] huobi_p [type="jsonparse" path="tick,data,0,price"] huobi_m [type=multiply input="$(huobi_p)" times=10000000000]

obviously a task to convert to uppercase would also be necessary

Additional Information chainlink node operator at gains.trade contact on discord & tg: @bitcollectr

PatrickAlphaC commented 2 years ago

Thank you! Adding

Tobias35 commented 2 years ago

@PatrickAlphaC do you have an eta on this yet ?

pappas999 commented 2 years ago

Hi @Tobias35 , thanks for raising again. The engineering team works on things based on priority, and unfortunately we don't have timelines for these community raised issues and feature requests. If you need something working now, you can implement some custom logic in an external adapter to handle string case conversion

archseer commented 2 years ago

Will be addressed in https://github.com/smartcontractkit/chainlink/pull/5751