sporeprotocol / spore-sdk

The Ultimate TypeScript SDK for Spore Protocol
https://docs.spore.pro
MIT License
12 stars 10 forks source link

Add a new interface to construct one transaction that combines Spore `melt` and `mint` operations simultaneously #94

Closed ashuralyk closed 5 months ago

ashuralyk commented 5 months ago

Description

We observed community always comes up a same requirement that iterate or update a Spore cell, since the immutability attribute of Spore cell, this operation can only be achieved by melt an old Spore cell and then mint a new Spore cell.

However, for safety concerns, splitting up above requirement into two transactions may have potential security issues, so combining them into one transaction is valuable for upcoming demands from our community.

To achieve, there should be a new high-level interface called migrateSpore that accepts a parameter melt_spore_id and the description for the mint spore, like this:

function migrateSpore(old_spore_id, new_spore, spore_owner, cluster_owner)
ashuralyk commented 5 months ago

@SpectreMercury see requirement here