-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
The API client library has a getGasInfo() method that calls /network/gas but should use the versioned path /api/v1/network/gas.
Current State
The library currently uses:
async getGasInfo(): Promise<GasInfo> {
return this.request<any>('/network/gas');
}Required Change
Update the path to use the /api/v1 prefix:
async getGasInfo(): Promise<GasInfo> {
return this.request<GasInfo>('/api/v1/network/gas');
}Implementation
File: src/core/zhtp-api-methods.ts
Line: 579
Change:
return this.request<any>('/network/gas');To:
return this.request<GasInfo>('/api/v1/network/gas');Type Definition
Ensure GasInfo type is properly defined in src/core/types.ts:
export interface GasInfo {
gasPrice: number;
estimatedCost: number;
baseFee?: number;
priorityFee?: number;
}Benefits
- Consistency: Uses
/api/v1prefix like other endpoints - Type Safety: Uses
GasInfotype instead ofany - Future-proof: Aligns with node's versioned API
Dependencies
Blocked by: Node Issue #112 - Missing /api/v1/network/gas endpoint
The node must implement this endpoint first before the library method will work.
Acceptance Criteria
- Path updated from
/network/gasto/api/v1/network/gas - Return type changed from
anytoGasInfo -
GasInfotype properly defined - Library builds successfully
- Method will work once node implements endpoint
Priority
P1 - HIGH - Required for transaction fee estimation in wallet
Related
- Node Issue #112: Missing network gas endpoint implementation
- Part of overall path standardization effort (Issue [FRONTEND]: API path inconsistencies between client and node #7)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels