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
Overview
When an asset is created in AssetsUp, it can optionally be registered on the Stellar blockchain via the
assetsupcontract, 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
assetsupcontract (contracts/assetsup/src/lib.rs) exposes aregister_assetfunction — review its parameters before implementingstellarAssetId,stellarTxHashfields to Asset entity (from BE-19) to track the on-chain IDAcceptance Criteria
POST /stellar/assets/registerbody:{ assetId: string }(internal asset UUID) — callsregister_asseton the Soroban contract with the asset metadata hash, stores returnedstellarAssetIdandstellarTxHashon theAssetrecordPOST /stellar/assets/:id/transferbody:{ toAddress: string }— calls the contract's transfer function, records the StellartxHashon theAssetHistoryentryGET /stellar/assets/:id— queries on-chain state for the asset (owner, registration timestamp, transfer count)409 Conflictif the asset is already registered on-chainstellarAssetId(nullable string) andstellarTxHash(nullable string) toAssetentity migration