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

Always use transfers_block_num for transfers by default #36

Merged
merged 1 commit into from
May 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ export async function makeUsageQuery(ctx: Context, endpoint: UsageEndpoints, use
query += `SELECT * FROM `;

const q = query_params as ValidUserParams<typeof endpoint>;
if (q.block_range) {
query += `transfers_block_num `;
} else if (q.from) {
if (q.from) {
query += `transfers_from `;
} else if (q.to) {
query += `transfers_to `;
} else if (q.contract || q.symcode) {
query += `transfers_contract `;
} else {
query += `transfer_events `;
query += `transfers_block_num `;
}

// FINAL increases ClickHouse query response time significantly when lots of data needs merging
Expand Down
Loading