kodadot / kodadot/packages

useRPC

Open
#154 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
11
PR merge metrics
No merged PRs in 30d

Description

```ts
import type { ApiPromise } from '@polkadot/api'

export function getMetadata(api: ApiPromise) {
return api.query.nft.instances
}

export function getMarketplaceData(api: ApiPromise) {
return api.query.nft.instances
}

export function getPrice(api: ApiPromise) {
return api.query.marketplace.prices
}

export function getOffers(api: ApiPromise) {
return api.query.marketplace.offers.keys
}

export function getOwner(api: ApiPromise) {
return api.query.uniques.asset
}

export function hasAllPallets(api: ApiPromise): boolean {
return [api.query.uniques, api.query.nft, api.query.marketplace].every(
(pallet) => pallet
)
}
```

We should have fallback RPC utils in case subsquid wont work

REF:
-

- kodadot/nft-gallery/pull/6443

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the getMetadata, getMarketplaceData, getPrice, getOffers, getOwner, and hasAllPallets entry points shown in the issue, and inspect how Subsquid currently supplies this data. Clarify the fallback behavior and the package entry point before implementing it. Done should provide RPC-based fallback utilities for the listed queries when Subsquid is unavailable, with tests or documented verification for the pallet checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, blockchain
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.