Function pallet_ip_pallet::pallet::dispatchables::complete_purchase
source · pub fn complete_purchase<T: Config>(contract_id: T::ContractId)Expand description
Completes a purchase contract after all payments are made
Finalizes NFT ownership transfer and cleans up contract storage. Can only be called when all payments have been completed.
§Arguments
origin- Any signed partycontract_id- ID of the purchase contract to complete
§Events
Event::ContractCompleted- When purchase is successfully completedEvent::NftRemovedFromEscrow- When NFT is released from escrow
§Errors
Error::ContractNotFound- If contract doesn’t existError::NotAPurchaseContract- If contract is a license contractError::NotPeriodicPayment- If contract is not a periodic payment contractError::PaymentNotCompleted- If any payments are still due
§State Changes
- Removes contract from
Contractsstorage - Updates
NFTContractsmapping to remove contract - Updates
Nftsstorage to reflect new owner - Removes NFT from
EscrowedNftsstorage
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::complete_purchase.