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

add indexer support to getRecord util #3608

Open
alvrs opened this issue Feb 27, 2025 · 1 comment
Open

add indexer support to getRecord util #3608

alvrs opened this issue Feb 27, 2025 · 1 comment
Labels
good first issue Good for newcomers

Comments

@alvrs
Copy link
Member

alvrs commented Feb 27, 2025

Currently getRecord always reads via a eth RPC call. We should add an optional indexerUrl param to read from the indexer instead.

export type GetRecordOptions<table extends Table> = {
address: Address;
table: table;
key: getSchemaPrimitives<getKeySchema<table>>;
blockTag?: "latest" | "pending";
};
export async function getRecord<table extends Table>(
client: Client,
{ address, table, key, blockTag }: GetRecordOptions<table>,
): Promise<getSchemaPrimitives<table["schema"]>> {

@alvrs alvrs added the good first issue Good for newcomers label Feb 27, 2025
@frolic
Copy link
Member

frolic commented Feb 27, 2025

or better yet we could infer this from client.chain.indexerUrl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

2 participants