@@ -67,25 +67,25 @@ public struct OwnershipTransferred has copy, drop {
6767/// field so the underlying ID can still be discovered by off-chain indexers.
6868public fun wrap <T : key + store >(cap: T , ctx: &mut TxContext ): TwoStepTransferWrapper <T > {
6969 let mut wrapper = TwoStepTransferWrapper { id: object::new (ctx) };
70- dof::add (&mut wrapper.id, Wrapped {} , cap);
70+ dof::add (&mut wrapper.id, WrappedKey () , cap);
7171 wrapper
7272}
7373
7474/// Borrow the wrapped capability immutably—useful for read-only inspection without touching the
7575/// transfer flow.
7676public fun borrow <T : key + store >(self: &TwoStepTransferWrapper <T >): &T {
77- dof::borrow (&self.id, Wrapped {} )
77+ dof::borrow (&self.id, WrappedKey () )
7878}
7979
8080/// Borrow the wrapped capability mutably when maintenance needs to happen without changing the
8181/// ownership state.
8282public fun borrow_mut <T : key + store >(self: &mut TwoStepTransferWrapper <T >): &mut T {
83- dof::borrow_mut (&mut self.id, Wrapped {} )
83+ dof::borrow_mut (&mut self.id, WrappedKey () )
8484}
8585
8686/// Take the wrapped capability from the `TwoStepTransferWrapper` with a guarantee that it will be returned.
8787public fun borrow_val <T : key + store >(self: &mut TwoStepTransferWrapper <T >): (T , Borrow ) {
88- let cap = dof::remove (&mut self.id, Wrapped {} );
88+ let cap = dof::remove (&mut self.id, WrappedKey () );
8989 let object_id = object::id (&cap);
9090 (cap, Borrow { wrapper_id: object::id (self), object_id })
9191}
@@ -102,14 +102,14 @@ public fun return_val<T: key + store>(
102102 assert ! (object::id (self) == wrapper_id, EWrongTwoStepTransferWrapper );
103103 assert ! (object::id (&capability) == object_id, EWrongTwoStepTransferObject );
104104
105- dof::add (&mut self.id, Wrapped {} , capability);
105+ dof::add (&mut self.id, WrappedKey () , capability);
106106}
107107
108108/// Permanently unwrap the capability, deleting the wrapper. Only the current owner can call this,
109109/// and it bypasses the request flow, effectively “owning” the capability again.
110110public fun unwrap <T : key + store >(self: TwoStepTransferWrapper <T >): T {
111111 let TwoStepTransferWrapper { id: mut wrapper_id } = self;
112- let cap = dof::remove (&mut wrapper_id, Wrapped {} );
112+ let cap = dof::remove (&mut wrapper_id, WrappedKey () );
113113 wrapper_id.delete ();
114114 cap
115115}
0 commit comments