@msafe/sui-app-store 0.0.365 → 0.0.366
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ You **do not write a helper**. You **do not wait for this package to publish**.
|
|
|
17
17
|
Writing a helper, forking `src/apps/**`, or opening a PR here will **not** list your dApp.
|
|
18
18
|
|
|
19
19
|
**New listing → [What you gain](#what-you-gain-in-this-version)** then [Current integration](#current-integration)
|
|
20
|
+
**Test in the MSafe iframe → [Test on preview](#test-on-preview)**
|
|
20
21
|
**Already started a helper → [How to change your dApp](#how-to-change-your-dapp)**
|
|
21
22
|
**Have an agent do the edit → [Prompt for your coding agent](#prompt-for-your-coding-agent)**
|
|
22
23
|
|
|
@@ -71,7 +72,7 @@ You are migrating this dApp onto the current MSafe store integration.
|
|
|
71
72
|
1. Read this README first and treat it as the only spec:
|
|
72
73
|
https://github.com/Momentum-Safe/msafe-sui-app-store/blob/main/README.md
|
|
73
74
|
If the user attached or opened a local copy of that README, use the local copy.
|
|
74
|
-
Follow “How to change your dApp
|
|
75
|
+
Follow “How to change your dApp”, “Current integration”, and “Test on preview”.
|
|
75
76
|
Ignore the collapsed “DEPRECATED archive”. Do not implement a helper.
|
|
76
77
|
|
|
77
78
|
2. Goal: MSafe is a normal Sui wallet. We submit a fully assembled Transaction.
|
|
@@ -105,9 +106,10 @@ You are migrating this dApp onto the current MSafe store integration.
|
|
|
105
106
|
app name, icon, production URL.
|
|
106
107
|
|
|
107
108
|
7. When done, list changed files and remaining checklist items from the README.
|
|
109
|
+
Tell the human to verify in the MSafe preview iframe (https://sui-preview.m-safe.io/) before asking for a store card.
|
|
108
110
|
```
|
|
109
111
|
|
|
110
|
-
After the agent finishes: send MSafe the app name, icon, and production URL so the store card can go up.
|
|
112
|
+
After the agent finishes: test on [preview](#test-on-preview), then send MSafe the app name, icon, and production URL so the store card can go up.
|
|
111
113
|
|
|
112
114
|
---
|
|
113
115
|
|
|
@@ -187,6 +189,7 @@ Keep your protocol SDK (Cetus SDK, NAVI SDK, your own `moveCall`s). Those alread
|
|
|
187
189
|
- [ ] No `appContext` on `signTransaction` / `signAndExecuteTransaction`
|
|
188
190
|
- [ ] `tx.setSender` is the **multisig** address (the connected MSafe account)
|
|
189
191
|
- [ ] Close any helper PR against this repository
|
|
192
|
+
- [ ] Verify in the [preview iframe](#test-on-preview) (`https://sui-preview.m-safe.io/`)
|
|
190
193
|
- [ ] Send MSafe: app name, icon, production URL — for the store card only
|
|
191
194
|
|
|
192
195
|
`signAndExecuteTransaction` **proposes** to the multisig queue. It does **not** return an on-chain digest. Owners vote and execute in MSafe.
|
|
@@ -245,11 +248,67 @@ The store iframe accepts **one** in-flight proposal. If the multisig already has
|
|
|
245
248
|
|
|
246
249
|
Listing is a **card**: name, icon, URL. MSafe adds `id` / `image` / `dappLink` on the web app. There is no adapter review and no `@msafe/sui-app-store` release on the critical path.
|
|
247
250
|
|
|
251
|
+
Test the iframe path on [preview](#test-on-preview) before you ask for the card.
|
|
252
|
+
|
|
248
253
|
### Reference
|
|
249
254
|
|
|
250
255
|
- Wallet SDK: https://github.com/Momentum-Safe/msafe-sui-wallet
|
|
251
256
|
- Sample dApp: https://github.com/Momentum-Safe/msafe-sui-app-arbitrary-transaction — follow the **wallet `Transaction`** path, not old `appContext` commits
|
|
252
257
|
- Live sample: https://sui-ptx.m-safe.io/
|
|
258
|
+
- Preview (mainnet iframe): https://sui-preview.m-safe.io/
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
## Test on preview
|
|
263
|
+
|
|
264
|
+
Use this to debug the real store iframe (simulate → propose → vote). Preview is **Sui mainnet** and talks to the production MSafe backend. Use a mainnet multisig you control. Do not send large amounts.
|
|
265
|
+
|
|
266
|
+
Preview: https://sui-preview.m-safe.io/
|
|
267
|
+
|
|
268
|
+
### Open your dApp in the iframe
|
|
269
|
+
|
|
270
|
+
1. Open https://sui-preview.m-safe.io/ and log in.
|
|
271
|
+
2. Select your mainnet MSafe account.
|
|
272
|
+
3. Go to **App Store → Custom dApp**.
|
|
273
|
+
4. Paste your **HTTPS** staging URL and click **Open dApp**.
|
|
274
|
+
|
|
275
|
+
Or, after you are logged in:
|
|
276
|
+
|
|
277
|
+
```
|
|
278
|
+
https://sui-preview.m-safe.io/store/sandbox?msafe=<YOUR_MSAFE_ADDRESS>&url=<encodeURIComponent(YOUR_HTTPS_URL)>
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`http://localhost` will not load here (HTTPS parent). Deploy a public HTTPS preview (Vercel, Cloudflare Tunnel, ngrok, …).
|
|
282
|
+
|
|
283
|
+
### iframe / CSP
|
|
284
|
+
|
|
285
|
+
Your page must allow MSafe to embed it:
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
Content-Security-Policy: frame-ancestors https://sui-preview.m-safe.io https://sui.m-safe.io;
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Do not send `X-Frame-Options: DENY` / `SAMEORIGIN`. A blank iframe is almost always CSP or `X-Frame-Options`.
|
|
292
|
+
|
|
293
|
+
### Expected flow
|
|
294
|
+
|
|
295
|
+
Your dApp builds a real PTB → MSafe wallet prompt → simulation → Propose → the tx appears in the MSafe **Transactions** queue → owners vote → execute.
|
|
296
|
+
|
|
297
|
+
`signAndExecuteTransaction` does **not** return an on-chain digest. That is expected.
|
|
298
|
+
|
|
299
|
+
The store iframe accepts **one** in-flight proposal. If the account already has a pending or future tx, finish or clear the queue before testing again.
|
|
300
|
+
|
|
301
|
+
### Common failures
|
|
302
|
+
|
|
303
|
+
| Symptom | Likely cause |
|
|
304
|
+
| --- | --- |
|
|
305
|
+
| Blank iframe | CSP / `X-Frame-Options` blocks embedding, or the URL is not HTTPS |
|
|
306
|
+
| `Empty transaction...` | You sent `new Transaction()` or an empty PTB |
|
|
307
|
+
| `Cannot destructure property 'content' of 'appContext'` | Still on the helper path; remove `appContext` and submit the real PTB |
|
|
308
|
+
| Simulation / propose works, no digest | Expected. Check the MSafe **Transactions** queue |
|
|
309
|
+
| Network mismatch | Register `MSafeWallet` with `'sui:mainnet'` |
|
|
310
|
+
|
|
311
|
+
When it works, send MSafe: **app name** (same string as `MSafeWallet('...')`), **icon**, **production URL**.
|
|
253
312
|
|
|
254
313
|
---
|
|
255
314
|
|