Skip to content

[FE] Generate TypeScript Bindings — Budget Allocation Contract #159

@Villarley

Description

@Villarley

[FE] Budget Allocation Service

Objective

Create a service that wraps the existing budget_allocation bindings for StarShop. (No binding generation required.)

File

src/lib/services/budgetAllocation.service.ts

API

  • initialize(admin, signer)
  • allocateFunds(admin, projectId, amount, signer) -> tx
  • updateAllocation(admin, projectId, newAmount, signer) -> tx
  • removeAllocation(admin, projectId, signer) -> tx
  • getAllocation(projectId)
  • getTotalAllocations()
  • listAllocations()

Tasks

  • Import client from src/lib/contracts/budget_allocation.ts.
  • Implement the methods above (reads without signer, writes with signer).
  • Validate amount fits i128 and projectId is a valid u32.
  • Return tx hash on writes.

Acceptance

  • Service file exists and compiles.
  • All methods typed and functional.
  • Read methods work without signer.
  • Write methods require signer and return tx hash.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions