Changeset View
Changeset View
Standalone View
Standalone View
cashtab/ecash-wallet-implementation.md
| Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | - **Migration Notes:** | ||||
| - NFT child minting was already migrated (uses ecash-wallet directly) | - NFT child minting was already migrated (uses ecash-wallet directly) | ||||
| --- | --- | ||||
| ### 4. components/Agora/OrderBook/index.tsx | ### 4. components/Agora/OrderBook/index.tsx | ||||
| **File:** `cashtab/src/components/Agora/OrderBook/index.tsx` | **File:** `cashtab/src/components/Agora/OrderBook/index.tsx` | ||||
| **Status:** ❌ Not migrated | **Status:** ✅ Migrated | ||||
| **Functions that send transactions:** | **Functions that send transactions:** | ||||
| #### 4.1. `cancelOffer()` (lines ~240-337) | #### 4.1. `cancelOffer()` (lines ~240-260) | ||||
| - **Status:** ✅ Migrated to ecash-wallet | |||||
| - **Purpose:** Cancel an Agora partial offer | - **Purpose:** Cancel an Agora partial offer | ||||
| - **Uses:** Direct `ecash-lib` and `ecash-agora` APIs | - **Uses:** `ecash-agora`'s `cancel()` method with `ecash-wallet` | ||||
| - **Transaction Building:** | |||||
| - Uses `agoraPartial.cancelTx()` from `ecash-agora` | |||||
| - Manually signs fuel inputs using `P2PKHSignatory` | |||||
| - Broadcasts via `chronik.broadcastTx()` | |||||
| - **Transaction Type:** Agora offer cancellation | - **Transaction Type:** Agora offer cancellation | ||||
| - **Migration Notes:** | |||||
| - Uses `agoraPartial.cancel()` from `ecash-agora` which handles fuel input selection and signing via `ecash-wallet` | |||||
| - `ecash-wallet` automatically handles fuel UTXO selection and signing | |||||
| - Broadcasting is handled by `ecash-wallet` via the `cancel()` method | |||||
| - Removed dependency on manual fuel input signing with `P2PKHSignatory` | |||||
| - Removed dependency on `getAgoraCancelFuelInputs()` and `ignoreUnspendableUtxos()` | |||||
| #### 4.2. `acceptOffer()` (lines ~339-461) | #### 4.2. `acceptOffer()` (lines ~262-320) | ||||
| - **Status:** ✅ Migrated to ecash-wallet | |||||
| - **Purpose:** Accept/buy an Agora partial offer | - **Purpose:** Accept/buy an Agora partial offer | ||||
| - **Uses:** Direct `ecash-lib` and `ecash-agora` APIs | - **Uses:** `ecash-agora`'s `take()` method with `ecash-wallet` | ||||
| - **Transaction Building:** | |||||
| - Uses `agoraPartial.acceptTx()` from `ecash-agora` | |||||
| - Manually signs fuel inputs using `P2PKHSignatory` | |||||
| - Broadcasts via `chronik.broadcastTx()` | |||||
| - **Transaction Type:** Agora offer acceptance | - **Transaction Type:** Agora offer acceptance | ||||
| - **Migration Notes:** | |||||
| **Migration Notes:** | - Uses `agoraPartial.take()` from `ecash-agora` which handles fuel input selection and signing via `ecash-wallet` | ||||
| - `ecash-wallet` automatically handles fuel UTXO selection and signing | |||||
| - These functions build transactions directly using `ecash-agora` and `ecash-lib` | - Broadcasting is handled by `ecash-wallet` via the `take()` method | ||||
| - They manually handle fuel input signing | - Removed dependency on manual fuel input signing with `P2PKHSignatory` | ||||
| - Should migrate to use `ecash-wallet` for fuel input handling and broadcasting | - Removed dependency on `getAgoraPartialAcceptFuelInputs()` and `ignoreUnspendableUtxos()` | ||||
| --- | --- | ||||
| ### 5. components/Agora/Collection/index.tsx | ### 5. components/Agora/Collection/index.tsx | ||||
| **File:** `cashtab/src/components/Agora/Collection/index.tsx` | **File:** `cashtab/src/components/Agora/Collection/index.tsx` | ||||
| **Status:** ❌ Not migrated | **Status:** ❌ Not migrated | ||||
| ▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | |||||
| - ✅ NFT child minting - Migrated to `ecash-wallet` (in `CreateTokenForm`) | - ✅ NFT child minting - Migrated to `ecash-wallet` (in `CreateTokenForm`) | ||||
| - ✅ Fan-out workflow - Removed (no longer needed) | - ✅ Fan-out workflow - Removed (no longer needed) | ||||
| - ✅ Cleanup: Removed unused helper functions (`getMintTargetOutputs`, `getAlpMintTargetOutputs`, `getSlpGenesisTargetOutput`, `getNftParentGenesisTargetOutputs`, `getAlpGenesisTargetOutputs`, `getAlpAgoraListTargetOutputs`, `getNft`) | - ✅ Cleanup: Removed unused helper functions (`getMintTargetOutputs`, `getAlpMintTargetOutputs`, `getSlpGenesisTargetOutput`, `getNftParentGenesisTargetOutputs`, `getAlpGenesisTargetOutputs`, `getAlpAgoraListTargetOutputs`, `getNft`) | ||||
| 2. Migrate `components/Etokens/CreateTokenForm/index.tsx` ✅ Complete | 2. Migrate `components/Etokens/CreateTokenForm/index.tsx` ✅ Complete | ||||
| - ✅ Token creation/genesis - Migrated to `ecash-wallet` | - ✅ Token creation/genesis - Migrated to `ecash-wallet` | ||||
| - ✅ NFT child minting - Already migrated (uses ecash-wallet directly) | - ✅ NFT child minting - Already migrated (uses ecash-wallet directly) | ||||
| 3. Migrate `components/Agora/OrderBook/index.tsx` | 3. Migrate `components/Agora/OrderBook/index.tsx` ✅ Complete | ||||
| - Replace direct `ecash-lib`/`ecash-agora` usage with `ecash-wallet` | - ✅ `cancelOffer()` - Migrated to use `agoraPartial.cancel()` with `ecash-wallet` | ||||
| - Use `ecash-wallet` for fuel input handling and broadcasting | - ✅ `acceptOffer()` - Migrated to use `agoraPartial.take()` with `ecash-wallet` | ||||
| - Requires `ecash-wallet` support for Agora transactions | |||||
| 4. Migrate `components/Agora/Collection/index.tsx` | 4. Migrate `components/Agora/Collection/index.tsx` | ||||
| - Similar to OrderBook, replace direct transaction building with `ecash-wallet` | - Similar to OrderBook, replace direct transaction building with `ecash-wallet` | ||||
| - Use `ecash-wallet` for fuel input handling and broadcasting | - Use `ecash-wallet` for fuel input handling and broadcasting | ||||
| ### Phase 2: Cleanup (Remove unused utilities) | ### Phase 2: Cleanup (Remove unused utilities) | ||||
| 5. Remove `transactions/index.js` and related transaction utilities | 5. Remove `transactions/index.js` and related transaction utilities | ||||
| Show All 31 Lines | |||||