Showing posts with label REST. Show all posts
Showing posts with label REST. Show all posts

Thursday, July 18, 2024

Rust pop-quiz answer: querying Terra swagger endpoint




This is a simple swagger-call at base, ... which I embellished (converting obvious numbers from strings), then embellished again (converting denom to token ... by hand).  

ℕ𝕆𝕋𝔼! The @terra_money swagger result for all_balances leaves out a 𝓼𝓲𝓰𝓷𝓲𝓯𝓲𝓬π“ͺ𝓷𝓽 number and types of tokens in my wallet, ...



... perhaps this lack is due to the many new and revised tokens introduced after the swagger endpoint was established (and abandoned?)

Sunday, June 9, 2024

Pivot pop-quiz: libraryitize reading REST endpoint

#Rust pop-quiz 02

Now that you can read from a REST endpoint, shunt that functionality into its own module, read_rest.rs that has the following function:

read_pivots() -> ErrStr<Vec<String>>

We'll be using this as a library function in follow-on quizzes. 

The library name? swerve

Pivot pop-quiz: read REST endpoint

#Rust pop-quiz: build a trade-recommender based upon pivots (more deets on pivots here)

quiz 01: read this REST endpoint.

That's it. You can print out the response if you'd like.

Anybody want to counterchallenge me with #Elixir?
  • (answer)

Fun fact!


Did you know that you – YES, YOU! – can make your git repository data a (GET) REST endpoint?

IT'S TRUE! HERE'S HOW IS ONE EASY STEP!

Your CSV, TSV, or, really, any data on github has a 'raw'-counterpart that can be queried, just like any GET REST endpoint.

Caveat 

These raw-representations are NOT updated instantly on a git push but there is a timed-delay of 5 minutes (300 seconds), so: if you do a git push and don't see the updates in the raw data, DON'T PANIC! This is not a bug, but a feature, from github. 

Tuesday, May 28, 2024

Rust pop-quiz: read Kujira Oracle REST endpoint

git as price-history database.

Thoughts?

#Rust (or ... #Elixir???) pop quiz:

From the @TeamKujira Oracle REST endpoint, and given today's date, $LE_DATE, '



convert the JSON response into the TSV, e.g.:

2024-05-28 5.16999452 1.613136506 1.204187945 8.710272459 
  • (answer)

Saturday, May 25, 2024

Kujira Oracle Rest endpoint




This list is notably incomplete. Right off the top: $AQLA is missing. There are others, but, importantly, the blue chips ($ETH, $BTC, $BNB) are there and the CØSMOS mainstays ($KUJI, $ATOM, $OSMO, $LUNA) are there with up-to-date prices.

Monday, March 4, 2024

Rust pop-quiz answer: accurate pricing of actively-traded tokens on Kujira FIN

#Rust pop-quiz answer to rewriting token-price-calculation.

A complete rewrite has now 60+ tokens accurately priced from active trades in @TeamKujira FIN.


This solution uses HashMap chaining and higher-order fuctional composition to avoid unnecessary collection-mutation. 





The above is part I to get to the solution.

Next comes part II: accurate order book volumes.

Sunday, July 30, 2023

Rust pop-answer: call REST endpoint

#Rust pop-answer to the quiz to embed a call to the CoinMarketCap REST endpoint.

The new ./cmc_prices entailed a wee bit o' reading from me, as I had to find out how to add header-information to the get-request to the REST endpoint.


Saturday, July 29, 2023

Rust pop-quiz: use REST endpoint

#Rust pop-quiz

My system, ./cmc_prices receives a dated JSON file from a curl extract.




Update it to extract these data from the @CoinMarketCap REST endpoint directly.