Skip to content

Commit 940759e

Browse files
committed
feat: media pipeline E2E verified β€” PSSH, authority, IPFS pin, GUI IPC fixes
Complete end-to-end media DRM pipeline now working: Creator mint β†’ buy β†’ download to node β†’ DASH/CENC playback inside PC2. Key fixes: - PSSH extraction: multi-pattern search (protocolVersion, data, protectionType) - PSSH metadata: embed ciphertext, dataToEncryptHash, contract-compatible kid - Authority address: corrected to 0x8fe6bf98 (real AuthorityGateway on Base) - IPFS pin: rewritten local detection using ipfs-unixfs-exporter (bypasses Helia fs.stat/fs.ls hangs on large directory DAGs) - GUI IPC: rebuilt bundle.min.js to deploy duplicate wallet signature fix - Chipotle client: enhanced retry logic, broader error pattern matching - Market app: skip signMessage in Chipotle mode, deduplicate SIWE login - ddrm-config template: corrected authority address Also includes Particle Auth SDK asset updates (Lit SDK upgrade). Docs updated: SESSION_HANDOVER.md and ROADMAP.md reflect E2E completion. Made-with: Cursor
1 parent bd21687 commit 940759e

133 files changed

Lines changed: 591 additions & 292 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": 1,
3+
"network": "chipotle-dev",
4+
"apiUrl": "https://api.dev.litprotocol.com",
5+
"usageKey": "REPLACE_WITH_USAGE_API_KEY",
6+
"pkpId": "0x09bdfc8f8ec5a3bd2970497b930bd94839f22227",
7+
"authority": "0x8fe6bf9877B78BF0126819ff2593235E54Ee1E29",
8+
"chain": "base",
9+
"chainId": 8453,
10+
"rpc": "https://mainnet.base.org",
11+
"actions": {
12+
"nonMediaEncrypt": "QmUdZUxe6BVoXiZcw4hE86YCHsgQVGEmgbN6sr7MhnL8pp",
13+
"nonMediaDecrypt": "QmfWksjQkuLxVGEZdHrbFKxUb2sL4K34bLYbD3mAKv2CZA"
14+
},
15+
"notes": "This file is deployed on each supernode. PC2 nodes fetch it on first startup. NEVER commit the real usageKey to git β€” provision it manually on each supernode after deployment."
16+
}

β€Ždocs/core/ROADMAP.mdβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ These diagrams from Rong define the north star. Every work stream should move us
139139
- [ ] Auto-pin + DHT announce for purchased content (CDN effect)
140140

141141
**Creator Tools:**
142-
- [x] Local media encoding pipeline β€” FFmpeg transcode + Bento4 fragment/package + CENC-AES-128-CTR encrypt + DASH packaging + IPFS upload. Adaptive codec selection (NVIDIA GPU / SVT-AV1 / x264). Creator Dashboard integration with detailed sub-step progress UI. Chipotle Lit Action CEK encryption. *(implemented Mar 17-18 β€” pending Lit API recovery for E2E completion)*
142+
- [x] Local media encoding pipeline β€” FFmpeg transcode + Bento4 fragment/package + CENC-AES-128-CTR encrypt + DASH packaging + IPFS upload. Adaptive codec selection (NVIDIA GPU / SVT-AV1 / x264). Creator Dashboard integration with detailed sub-step progress UI. Chipotle Lit Action CEK encryption. **E2E verified Mar 18**: Creator mint β†’ buy β†’ download β†’ DASH playback inside PC2. *(completed Mar 17-18)*
143143
- [x] Media encoding progress UX β€” real-time sub-step tracking (Analyze β†’ Transcode β†’ Fragment β†’ CENC Encrypt β†’ IPFS Upload), per-step inline progress bars, live FFmpeg stats (speed, FPS, elapsed time), weighted overall progress *(implemented Mar 18)*
144144
- [ ] App Factory β€” local packaging pipeline (build β†’ bundle β†’ IPFS pin β†’ publish)
145145
- [x] Creator Dashboard dApp β€” upload any file, set price/royalties, encrypt via Lit Protocol, upload to IPFS *(implemented Mar 13 β€” pc2-node/data/test-apps/elacity-creator/)*
@@ -173,7 +173,7 @@ These diagrams from Rong define the north star. Every work stream should move us
173173
- [x] **WASM-native PDF rendering** β€” Replaced `lopdf` (WASM crash) with `hayro` pure-Rust PDF rasterizer for full-fidelity rendering (layout, fonts, tables, images). Fixed WASI compilation target (`wasm32-wasip1`). Node.js canvas fallback text wrapping fixed. Elacity brand blue (`#3b82f6`) applied to viewer. "Mint on Elacity" right-click for non-dDRM files. Wallet bridge restored *(completed Mar 16)*
174174
- [x] **WASM crypto hardening (Phases A-C)** β€” AES-GCM decrypt-only mode in WASM (CEK never in Node.js heap, 50MB threshold), fMP4 strip+decrypt combined in single WASM call (Rust port with 64-bit box support), `build-wasm.sh` pipeline, `wasm32-wasip1` toolchain. PDF text extraction spike confirmed `hayro-syntax` lacks CMap resolution β€” keeping `pdfjs-dist`. Phase D (Lit Chipotle) COMPLETE. Phase E (ECDH to WASM) conditional on Chipotle envelope format.
175175
- [x] **Bug fixes (Mar 16)** β€” Fixed double-signature bug (duplicate `pc2-wallet-bridge.js` + `IPC.js` handlers), fixed WASM text renderer exceeding JPEG 65535px limit, fixed video autoplay after signing, fixed `eth_requestAccounts` prompting unnecessarily (use `eth_accounts` first). Removed duplicate `eth_sendTransaction` handler from ParticleNetworkContext
176-
- [x] **Bug fixes (Mar 18)** β€” Fixed duplicate wallet signatures (IPC.js + pc2-wallet-bridge.js dual handling), fixed "Network fee: Unavailable" (removed explicit gas estimation, let MetaMask handle), fixed duplicate chain switch popup (check current chain before switching), fixed duplicate SIWE login on account change, fixed media encode `dataToEncryptHash` propagation for correct minting contentId, fixed IPFS directory pinning for DASH packages (Helia `storeDirectory` + local directory detection in `pinRemoteCID`)
176+
- [x] **Bug fixes (Mar 18)** β€” Fixed duplicate wallet signatures (IPC.js + pc2-wallet-bridge.js dual handling), fixed "Network fee: Unavailable" (removed explicit gas estimation, let MetaMask handle), fixed duplicate chain switch popup (check current chain before switching), fixed duplicate SIWE login on account change, fixed media encode `dataToEncryptHash` propagation for correct minting contentId, fixed IPFS directory pinning for DASH packages (Helia `storeDirectory` + local directory detection in `pinRemoteCID`), fixed PSSH extraction (multi-pattern search), fixed PSSH ciphertext/hash/kid embedding, fixed authority address (`0x8fe6bf98...` AuthorityGateway on Base), fixed GUI IPC rebuild (bundle.min.js), **E2E verified: mint β†’ buy β†’ download β†’ playback**
177177
- [x] **dDRM Viewer native windowing** β€” launches as UIWindow via IPC `postMessage` β†’ `launch_app()` (not browser popup), integrated with taskbar *(completed Mar 15)*
178178
- [x] **.ddrm.json capsule format** β€” descriptor files for non-media assets with CID, Lit params, mimeType. MIME: `application/x-ddrm+json`. Saved to Documents *(completed Mar 15)*
179179
- [x] **GUI capsule integration** β€” custom shield icon, MIME registration, double-click opens dDRM Viewer, content_type_to_icon mapping *(completed Mar 15)*
@@ -315,7 +315,7 @@ These diagrams from Rong define the north star. Every work stream should move us
315315
- [x] **dDRM Viewer** β€” dedicated secure viewer app with native PC2 windowing, scrollable document view, .ddrm.json capsule support *(completed Mar 15)*
316316
- [x] **GUI file type integration** β€” `.ddrm.json` icon, MIME, double-click β†’ dDRM Viewer *(completed Mar 15)*
317317
- [x] **PC2 Media Runtime** β€” server-side DASH/CENC decryption: Rust WASM cenc-decrypt crate + MSE player + DRM stripping + Lit CEK recovery. End-to-end video playback verified *(completed Mar 16)*
318-
- [x] **Lit Chipotle migration** β€” Datil deprecated ~April 25, 2026. Replaced v7 SDK with REST API. `chipotle-client.ts` module, `LIT_BACKEND` feature flag, dual-mode rollback. Non-media encrypt/decrypt E2E verified on new dev network. Auto-provisioning coded. **RELEASE BLOCKER: supernode deployment pending.** See `docs/core/LIT_PRODUCTION_CHECKLIST.md` *(completed Mar 13-18)*
318+
- [x] **Lit Chipotle migration** β€” Datil deprecated ~April 25, 2026. Replaced v7 SDK with REST API. `chipotle-client.ts` module, `LIT_BACKEND` feature flag, dual-mode rollback. Non-media + media encrypt/decrypt E2E verified on new dev network. Auto-provisioning coded. **RELEASE BLOCKER: supernode deployment pending.** See `docs/core/LIT_PRODUCTION_CHECKLIST.md` *(completed Mar 13-18)*
319319
- [ ] On-chain content indexer β€” replace Elacity GraphQL dependency with event scanner (The Graph / custom). See [DECENTRALIZATION_STATUS.md](./DECENTRALIZATION_STATUS.md) Tier 1.1
320320
- [ ] Self-provisioned RLI tokens β€” each PC2 node mints own capacity credits, removes Elacity wallet dependency. See Tier 1.3
321321
- [ ] AI Model Marketplace alpha β€” encrypt GGUF/SafeTensors model β†’ IPFS β†’ ACCESS_TOKEN β†’ decrypt on PC2 β†’ load in Ollama
@@ -738,7 +738,7 @@ Starting Month 1 (March 2026):
738738
| Release | Target | Focus |
739739
|---------|--------|-------|
740740
| v1.1.0 | March 2026 | Merge Jetson branch, bug fixes, AV1 player |
741-
| v1.2.0 | April 2026 | **Lit Chipotle dDRM** (non-media DONE, media encoding pipeline BUILT β€” pending Lit API recovery), local media encoding (FFmpeg+Bento4+CENC+DASH), supernode provisioning, hardware expansion, installer improvements, WireGuard bundling |
741+
| v1.2.0 | April 2026 | **Lit Chipotle dDRM** (non-media DONE, media E2E DONE Mar 18), local media encoding (FFmpeg+Bento4+CENC+DASH β€” E2E verified), supernode provisioning deployment, hardware expansion, installer improvements, WireGuard bundling |
742742
| v1.3.0 | May 2026 | AI Model Marketplace alpha (GGUF→Ollama), dApp bundles, datasets, `@elacity-js/asset-packager` |
743743
| v1.4.0 | June 2026 | WASM-native CENC encrypt + PSSH gen (replace Bento4 binaries), fiat onramp, Rust optimization sprint |
744744
| v1.5.0 | July 2026 | dApp Store v1 (categories, ratings, HTML5 games, 3D viewer), mobile companion alpha |

β€Ždocs/core/SESSION_HANDOVER.mdβ€Ž

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
**Release:** v1.1.0 tagged and released on 2026-03-03 (134 commits squash-merged to main)
1212
**Launcher:** v1.1.1 released β€” version display, one-click updates, full networking install
1313
**DAO Proposal:** Live at https://elastos.com/proposals/69a24f49247f130078064edd
14-
**Last Commit:** feat: media encoding pipeline (transcode→fragment→CENC→DASH→IPFS), IPC duplicate fix
14+
**Last Commit:** feat: media pipeline E2E β€” PSSH extraction fix, authority address fix, IPFS pin fix, GUI IPC rebuild, end-to-end video playback + download verified
1515

1616
### What Just Shipped (v1.1.0 on main)
1717

@@ -348,7 +348,7 @@ Full technical spec at `docs/core/ACCESS_PACKAGE_SPEC.md`. Key decisions:
348348
- [x] **PC2 Media Runtime** β€” Rust WASM `cenc-decrypt` crate (AES-128-CTR per-sample, 16-byte IVs), MSE player (no EME/CDM), DRM stripping (init+segment), two-phase Lit auth, SA-aware PSSH selection. **End-to-end DASH video playback verified** *(completed Mar 16)*
349349
- [x] Lit Chipotle migration β€” Phases 0-5 complete (Mar 13-17). `chipotle-client.ts` replaces Lit SDK. `LIT_BACKEND=chipotle|datil` feature flag. **E2E round-trip verified** (Mar 17): encrypt + decrypt + plaintext match confirmed.
350350

351-
#### Media Encoding Pipeline β€” WORKING (Pending Lit API Recovery) (Mar 17-18)
351+
#### Media Encoding Pipeline β€” WORKING END-TO-END (Mar 17-18)
352352

353353
Built a complete local media encoding pipeline for the Creator Dashboard. Video/audio files uploaded by creators are transcoded, fragmented, CENC-encrypted, and packaged as DASH streams β€” all on the local PC2 node, no cloud dependency.
354354

@@ -380,8 +380,9 @@ Built a complete local media encoding pipeline for the Creator Dashboard. Video/
380380

381381
**IPFS integration:**
382382
- `uploadDashToIPFS()` uses Helia `storeDirectory()` for correct UnixFS directory CIDs
383-
- `pinRemoteCID()` enhanced: local `fs.stat()` check for directories, instant recursive fetch for already-local content
383+
- `pinRemoteCID()` enhanced: uses `ipfs-unixfs-exporter` for robust local directory detection, bypasses Helia `fs.stat()`/`fs.ls()` hangs on large DAGs, `fetchDirectoryRecursive()` uses `entry.size` metadata instead of reading all bytes
384384
- Best-effort replication of individual DASH files to Elacity IPFS gateway for multi-node reachability
385+
- Downloaded content stored in PC2 virtual filesystem (IPFS blockstore) with `.edrm` descriptor in user's Videos folder β€” NOT in native OS Finder
385386

386387
**Critical bug fix β€” Duplicate wallet signatures (IPC):**
387388
- Root cause: Both `src/gui/src/IPC.js` and `pc2-node/src/wallet-bridge/pc2-wallet-bridge.js` independently listened for `pc2-wallet-rpc` messages and forwarded them to `window.ethereum`
@@ -396,12 +397,21 @@ Built a complete local media encoding pipeline for the Creator Dashboard. Video/
396397
- Market `onAccountChange` deduplication β€” prevents double SIWE login
397398
- `EncodeJob` interface returns `dataToEncryptHash` and `ciphertext` for correct minting `contentId`
398399

399-
**Current status:** Pipeline works end-to-end through transcoding, fragmenting, and IPFS upload. CENC encryption step blocked by Lit Chipotle API outage (Phala TEE backend TLS failure). Retry mechanism in place β€” will recover automatically when Lit infrastructure comes back.
400+
**Current status:** Pipeline works end-to-end. **Video playback verified** β€” Creator mint β†’ buy β†’ download β†’ PC2 Media Player plays DASH/CENC-encrypted video. Download saves `.edrm` descriptor to user's Videos folder in PC2 virtual filesystem.
401+
402+
**Critical fixes applied (Mar 18 β€” E2E session):**
403+
- **PSSH extraction pattern** β€” `extractPSSHJson()` searched for `{"data":{` but Bento4 PSSH JSON starts with `{"protocolVersion":`. Fixed to search multiple patterns.
404+
- **PSSH missing ciphertext/hash** β€” `buildPSSHJson()` was called before CEK encryption, so PSSH lacked `ciphertext` and `dataToEncryptHash`. Restructured flow: encrypt CEK first, then build PSSH with result.
405+
- **PSSH wrong authority address** β€” `DEFAULT_AUTHORITY` was `0x580c26De...` (incorrect contract). Changed to `0x8fe6bf98...` (the real AuthorityGateway on Base that implements `hasAccessByContentId`). Long-term: authority should be passed dynamically per-channel from creator app.
406+
- **PSSH kid mismatch** β€” `kid` was a random UUID from `generateCEK()`, but contract registers `hashToContentId(dataToEncryptHash)`. Fixed: `buildPSSHJson` now derives kid from encryption hash using same formula as creator app.
407+
- **IPFS pin hanging** β€” `pinRemoteCID` called `fs.stat()` and `fs.ls()` which both hang on large UnixFS directory DAGs in Helia. Rewrote local detection to use `ipfs-unixfs-exporter` directly against blockstore (fast, bypasses Helia's blocking layers).
408+
- **GUI IPC not rebuilt** β€” `src/gui/src/IPC.js` had the duplicate wallet fix in source but GUI bundle was never rebuilt. Ran `npm run build:only` in `src/gui/` to compile fix into `dist/bundle.min.js`.
400409

401410
**Known issues:**
402411
- Elacity frontend UA receipt parsing: `UAReceiptFetcher.enrichOperationsWithContracts` throws `TypeError` after successful on-chain purchase. Bug is in Elacity's frontend, not our code.
403412
- MPD parser error for image assets: Elacity's media player tries to parse image metadata as DASH manifest. Expected for non-video content.
404413
- Lit Datil deprecation: Datil network being deprecated ~April 25, 2026 in favor of Chipotle (REST API, API key auth, TEE-based). Migration required.
414+
- Authority address is hardcoded to Base AuthorityGateway `0x8fe6bf98...`. Works for all Base channels (shared gateway). Long-term: creator app should pass resolved authority into encode endpoint for per-channel support.
405415

406416
#### PC2 Media Runtime β€” WORKING END-TO-END (Mar 15-16)
407417

@@ -482,7 +492,7 @@ Comprehensive player hardening and UX polish:
482492
1. ~~**Lit Chipotle migration**~~ β€” **DONE (Mar 13-18)** β€” Phases 0-5 complete. Migrated to new `chipotle-dev` network. All Lit Action CIDs registered. Pinned encrypt action (`non-media-encrypt-chipotle.js`). Auto-provisioning from supernodes built. **E2E verified** (PDF, image, text β€” all decrypt via Chipotle on new platform).
483493
2. ~~**End-to-end testing**~~ β€” **DONE (Mar 18)** β€” Full Creator mint β†’ buy β†’ dDRM Viewer decrypt verified on new Lit dev network. WASM rendering, watermarks, on-chain access check all confirmed working.
484494
3. **Deploy supernode provisioning** β€” `/api/ddrm/provision` endpoint coded but NOT deployed to supernodes. See `docs/core/LIT_PRODUCTION_CHECKLIST.md` for deployment steps. **This is a v1.2.0 release blocker.**
485-
4. **Media pipeline on Chipotle** β€” Full encoding pipeline built and tested (transcode, fragment, IPFS upload all working). CENC encryption blocked by Lit Chipotle API outage (Phala TEE backend). Retry mechanism in place (5 attempts, exponential backoff). Will complete E2E once Lit recovers. See media encoding pipeline section above.
495+
4. ~~**Media pipeline on Chipotle**~~ β€” **DONE (Mar 18)** β€” Full encoding pipeline E2E verified: transcode β†’ fragment β†’ CENC encrypt β†’ DASH package β†’ IPFS upload β†’ mint β†’ buy β†’ download β†’ playback. PSSH includes ciphertext, hash, contract-compatible kid, correct authority. Lit Chipotle API recovered.
486496
5. **P-256 ECDH unwrap to WASM (Phase E)** β€” conditional on Chipotle envelope format. If Chipotle returns CEK directly, this phase is eliminated.
487497
6. **`cenc-encrypt` Rust WASM crate** β€” Symmetric counterpart to `cenc-decrypt`. AES-128-CTR encryption in WASM, replaces `mp4encrypt` Bento4 binary. Uses identical crypto primitives from `cenc-decrypt/cenc.rs`. Target: `wasm32-wasip1`.
488498
7. **`pssh-gen` Rust WASM crate** β€” PSSH box generator per ISO 23001-7. Produces binary PSSH boxes from Elacity dDRM metadata. Replaces JSON-based approach in `dashPackager.ts`.
@@ -697,7 +707,7 @@ Chipotle TEE available `Lit.Actions` methods:
697707
- [dDRM Pipeline E2E](fd6755f0-d73c-4e41-8df3-0f57f15071a2) β€” @elacity-js/access, Creator Dashboard, Lit Action trust model (Path A), capacity credit auto-detection, decrypt endpoint, decentralization analysis. Also: hayro PDF rendering, WASM text fixes, Mint context menu, wallet bridge restore, Elacity branding, WASM crypto hardening Phases A-C, double-signature fix, TXT dimension cap, video autoplay, fMP4 strip+decrypt in Rust
698708
- [Secure Viewer & PDF](fd6755f0-d73c-4e41-8df3-0f57f15071a2) β€” secure viewer pipeline, PDF hybrid rendering, two-layer encryption fix, Lit Pinata/relayer integration, auto-decrypt, parallel pages, dDRM Viewer app, .ddrm.json capsules, WASM renderer, GUI integration
699709
- [Media Runtime E2E](fd6755f0-d73c-4e41-8df3-0f57f15071a2) β€” server-side DASH/CENC decryption pipeline, Rust WASM cenc-decrypt crate, MSE player, DRM stripping (init+segment), 16-byte IV fix, Smart Account PSSH, two-phase Lit auth
700-
- [Media Encoding Pipeline](current) — Local media encoding pipeline (FFmpeg→Bento4→CENC→DASH→IPFS), Chipotle CEK encryption, Creator Dashboard media UI, IPC duplicate wallet fix, MetaMask gas estimation fix
710+
- [Media Encoding Pipeline](current) — Local media encoding pipeline (FFmpeg→Bento4→CENC→DASH→IPFS), Chipotle CEK encryption, Creator Dashboard media UI, IPC duplicate wallet fix, MetaMask gas estimation fix, PSSH extraction/authority/kid fixes, IPFS pin hang fix, GUI rebuild, **E2E playback + download verified**
701711

702712
---
703713

β€Žpc2-node/.gitignoreβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Thumbs.db
3333
data/.chipotle-api-key
3434
data/.chipotle-user-key
3535
data/.chipotle-account-key
36+
data/.chipotle-provision.json
3637

3738
# Dev-only test scripts containing secrets
3839
scripts/test-chipotle-phase1.mjs

β€Žpc2-node/data/test-apps/elacity-market/app.jsβ€Ž

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,17 +1713,29 @@
17131713

17141714
// Phase 1: Ask the server to start a Lit session and return the SIWE message
17151715
prepareLitAuth(checksumAddr).then(function (prepareResult) {
1716-
showToast('Please sign the Lit authentication message...', 'info');
1717-
1718-
// Phase 2: Sign the SIWE message from the server (contains ReCap capabilities)
1719-
return Wallet.signMessage(prepareResult.siweMessage).then(function (sig) {
1720-
var authSig = {
1721-
sig: sig,
1722-
derivedVia: 'web3.eth.personal.sign',
1723-
signedMessage: prepareResult.siweMessage,
1716+
1717+
// Chipotle mode: server returns siweMessage=null, no signing needed
1718+
var authSigPromise;
1719+
if (prepareResult.chipotleMode || !prepareResult.siweMessage) {
1720+
authSigPromise = Promise.resolve({
1721+
sig: '0x',
1722+
derivedVia: 'chipotle-api-key',
1723+
signedMessage: '',
17241724
address: checksumAddr
1725-
};
1725+
});
1726+
} else {
1727+
showToast('Please sign the Lit authentication message...', 'info');
1728+
authSigPromise = Wallet.signMessage(prepareResult.siweMessage).then(function (sig) {
1729+
return {
1730+
sig: sig,
1731+
derivedVia: 'web3.eth.personal.sign',
1732+
signedMessage: prepareResult.siweMessage,
1733+
address: checksumAddr
1734+
};
1735+
});
1736+
}
17261737

1738+
return authSigPromise.then(function (authSig) {
17271739
window.parent.postMessage({
17281740
msg: 'launchApp',
17291741
appName: 'pc2-media-runtime',
@@ -2341,8 +2353,10 @@
23412353
onAccountChange: function () {
23422354
updateWalletUI();
23432355
if (state.initializing) return;
2356+
if (state._lastSignedAddress === Wallet.getAddress()) return;
23442357
ElacityAPI.clearAuth();
23452358
state.assetsItems = [];
2359+
state._lastSignedAddress = Wallet.getAddress();
23462360
Wallet.siweLogin()
23472361
.then(function () {
23482362
updateWalletUI();
@@ -2371,6 +2385,7 @@
23712385
})
23722386
.then(function () {
23732387
state.initializing = false;
2388+
state._lastSignedAddress = Wallet.getAddress();
23742389
updateWalletUI();
23752390
syncSubscriptionsFromAPI();
23762391
if (state.activeView === 'library') renderMyAssetsView();

β€Žpc2-node/data/test-apps/elacity-market/wallet.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ var Wallet = (function () {
173173
// ── Chain Switching ──────────────────────────────────
174174

175175
function switchToBase() {
176+
if (currentChainId === BASE_CHAIN_ID) return Promise.resolve();
176177
return getProvider().request({
177178
method: 'wallet_switchEthereumChain',
178179
params: [{ chainId: BASE_CHAIN_ID }]

0 commit comments

Comments
Β (0)