Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Add Kyve specific features. #43

Open
Errorist79 opened this issue Feb 15, 2023 · 1 comment
Open

Feat: Add Kyve specific features. #43

Errorist79 opened this issue Feb 15, 2023 · 1 comment

Comments

@Errorist79
Copy link
Member

Errorist79 commented Feb 15, 2023

Kyve ağı için bazı özel eklemeler de bulunacağız.

Pools

Pools: https://kyve-testnet-api.itrocket.net/#/QueryPool/Pools

Pool details by id: https://kyve-testnet-api.itrocket.net/#/QueryPool/Pool

Pool validators (stakers) & delegators/unbondings

Validators (stakers): https://kyve-testnet-api.itrocket.net/#/QueryStakers/StakersByPool

Delegations etc.. query: https://kyve-testnet-api.itrocket.net/#/QueryAccount

Bundles

Finalized: https://kyve-testnet-api.itrocket.net/#/QueryBundles/FinalizedBundles

Finalized bundle by id: https://kyve-testnet-api.itrocket.net/#/QueryBundles/FinalizedBundle

Calculate bundle rewards:

https://docs.kyve.network/token_holders/advanced/data_stored#5-finalizing-the-bundle

@Errorist79
Copy link
Member Author

Pools

Poollar'ı nasıl çekeceğimize bakalım.
Test için base URL: https://api.korellia.kyve.network

Endpoint: /kyve/query/v1beta1/pools?pagination.limit=100

Dönen response bize active olan polları ve polların bazı detaylarını iletir.

Bir poll için, bu endpointte alacağımız veriler şunlardır;
id, runtime, logo, total_bundles, total_delegation, progress.

Şimdi bunları nasıl kullanacağımıza bakacağız:

id: direkt olarak değeri alacağız.

runtime: direkt olarak değer.

total_bundles: direkt olarak değer.

total_delegation: direkt olarak değer.

summary: current_summary değeri

logo: logo arweave üzerinde konumlandırılmış. bu yüzden burada farklı bir durum var.
Yaptığımız request'te bize dönen veri şu formatta geliyor.
"logo": "ar://9FJDam56yBbmvn8rlamEucATH5UcYqSBw468rlCXn8E"
Bu veride, ar:// sonrasında gelen değeri kullanarak farklı bir request yapacağız.

https://arweave.net/{logo_url}

Örneğin bu değeri kullanarak örneklendirelim:
https://arweave.net/9FJDam56yBbmvn8rlamEucATH5UcYqSBw468rlCXn8E

progress:

Bu direkt olarak değer alıpta kullanabileceğimiz bir şey değil. Pool ilerlemesini gösteren bir şey. biraz detaylı olacağı için şimdilik bu kısmı atlayacağız.

Pool details

Burada bir kaç farklı endpoint kullanılacak. 1. si ile başlayalım.

Endpoint: /kyve/query/v1beta1/pool/{pool_id}

Pool'ları çektiğimiz endpointte id değerini bu endpointte kullanacağız.

Örnek request:
https://api.korellia.kyve.network/kyve/query/v1beta1/pool/0

Alınacak değerler:

Bir üstte Pools başlığı altında ki değerler alınacak, ekstra olarak:

Funders: funders başlığı altında ki address ve amount.

total_funds, total_self_delegation, min_delegation, current_storage_provider_id, current_compression_id ve current_key değerleri.

Vote status:

  1. Endpoint: /kyve/query/v1beta1/current_vote_status/{pool_id}

Örnek request:
https://api.korellia.kyve.network/kyve/query/v1beta1/current_vote_status/0

Burada total değer ve 3 oy durumu vardır. oy durumlarını yüzdelik olarak hesaplayacağız. Örnek:

image

Pool validators

Endpoint: /kyve/query/v1beta1/stakers_by_pool/{pool_id}

Alınacak değerler:

address, commission, moniker, website, logo, total_delegation, self_delegation.

Pools:

pools altında ki poollardan bazı değerleri alacağız.

id, name, runtime, logo, valaddress, balance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant