Skip to content

[BE-61] Implement Stellar asset registration and on-chain transfer via assetsup contract #934

Description

@yusuftomilola

Overview

When an asset is created in AssetsUp, it can optionally be registered on the Stellar blockchain via the assetsup contract, creating an immutable on-chain record. Transfers can also be recorded on-chain. This gives the asset an on-chain identity that cannot be altered or deleted.

Context

  • Depends on BE-60 (StellarService)
  • The assetsup contract (contracts/assetsup/src/lib.rs) exposes a register_asset function — review its parameters before implementing
  • On-chain registration should be optional (not every organisation needs blockchain anchoring)
  • Add stellarAssetId, stellarTxHash fields to Asset entity (from BE-19) to track the on-chain ID

Acceptance Criteria

  • POST /stellar/assets/register body: { assetId: string } (internal asset UUID) — calls register_asset on the Soroban contract with the asset metadata hash, stores returned stellarAssetId and stellarTxHash on the Asset record
  • POST /stellar/assets/:id/transfer body: { toAddress: string } — calls the contract's transfer function, records the Stellar txHash on the AssetHistory entry
  • GET /stellar/assets/:id — queries on-chain state for the asset (owner, registration timestamp, transfer count)
  • Both endpoints return 409 Conflict if the asset is already registered on-chain
  • Add stellarAssetId (nullable string) and stellarTxHash (nullable string) to Asset entity migration

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions