Skip to content

[P1] Verify and update API paths to /api/v1 standard #18

@umwelt

Description

@umwelt

Overview

Verify that all API client methods use the correct /api/v1 path prefix and are aligned with the ZHTP node's current API structure.

Parent Issue

Part of #17 - Priority 1 tasks

Current Status

Most paths already use /api/v1 prefix, but need comprehensive verification and testing.

Tasks

Path Verification

  • Audit all methods in src/core/zhtp-api-methods.ts
  • Verify all paths match node implementation
  • Check contract paths use /api/v1/blockchain/contracts/*
  • Verify gas pricing uses /api/v1/network/gas
  • Confirm all old paths removed

Testing

  • Test backward compatibility (node has aliases)
  • Verify all methods hit correct endpoints
  • Add integration tests for path correctness
  • Document any path changes

Expected Paths

Already Correct (verify)

  • /api/v1/identity/signin
  • /api/v1/identity/login
  • /api/v1/identity/create
  • /api/v1/dao/proposals/list
  • /api/v1/dao/vote/cast
  • /api/v1/dao/treasury/status

Need Verification

  • Contract paths: Should use /api/v1/blockchain/contracts/*
  • Gas pricing: Should use /api/v1/network/gas
  • Node status: Should use /api/v1/protocol/info
  • Blockchain info: Should use /api/v1/blockchain/status

Backward Compatibility Notes

The node supports old paths via aliases:

  • /dao/proposals/api/v1/dao/proposals/list
  • /network/gas/api/v1/network/gas
  • /node/status/api/v1/protocol/info

While these work, the client should use the new canonical paths.

Acceptance Criteria

  • All methods use /api/v1 prefix where applicable
  • Integration tests pass
  • Documentation updated
  • No breaking changes for existing users

Related Issues

Estimated Effort

Small - 2-3 hours (mostly verification and testing)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions