create-partylayer-app 0.5.0 → 0.5.1
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/package.json +1 -1
- package/templates/next-ssr/README.md +4 -4
- package/templates/next-ssr/_package.json +1 -1
- package/templates/react-dvp/README.md +6 -0
- package/templates/react-dvp/_package.json +1 -1
- package/templates/react-tokenization/README.md +6 -0
- package/templates/react-tokenization/_package.json +1 -1
- package/templates/react-vite/README.md +2 -2
- package/templates/react-vite/_package.json +1 -1
- package/templates/vanilla/README.md +2 -2
- package/templates/vanilla/_package.json +1 -1
- package/templates/vanilla/src/main.ts +2 -2
- package/templates/vue-nuxt-pinia/README.md +3 -3
- package/templates/vue-nuxt-pinia/_package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
-
A [PartyLayer](https://partylayer.xyz) dApp
|
|
3
|
+
A [PartyLayer](https://partylayer.xyz) dApp: Next.js App Router with **SSR session**.
|
|
4
4
|
|
|
5
5
|
## Develop
|
|
6
6
|
|
|
@@ -11,8 +11,8 @@ npm run dev
|
|
|
11
11
|
## How SSR session works
|
|
12
12
|
|
|
13
13
|
- **Server** ([lib/session.ts](lib/session.ts)) reads the session cookie via `next/headers` `cookies()` + `@partylayer/session`'s `createCookieStorage` → the connected party is rendered in the **initial HTML** (no disconnected→connected flash). `app/page.tsx` is a Server Component that gates on `getServerSession()`.
|
|
14
|
-
- **Client** ([app/providers.tsx](app/providers.tsx)) wraps the app in `PartyLayerKit` with `sessionOptions={{ storage: createCookieStorage() }}
|
|
15
|
-
- `next/headers` is imported only in your app (`lib/session.ts`), never in `@partylayer/session
|
|
14
|
+
- **Client** ([app/providers.tsx](app/providers.tsx)) wraps the app in `PartyLayerKit` with `sessionOptions={{ storage: createCookieStorage() }}`. This uses `document.cookie` (synchronous), the **same** cookie the server reads.
|
|
15
|
+
- `next/headers` is imported only in your app (`lib/session.ts`), never in `@partylayer/session`. The library stays framework-agnostic.
|
|
16
16
|
|
|
17
17
|
Switch networks by changing `network` in `app/providers.tsx` and `appName` accordingly.
|
|
18
18
|
|
|
@@ -25,4 +25,4 @@ npm run build && npm start
|
|
|
25
25
|
## Docs
|
|
26
26
|
|
|
27
27
|
- [PartyLayer docs](https://partylayer.xyz/docs/introduction)
|
|
28
|
-
- [@partylayer/session
|
|
28
|
+
- [@partylayer/session: createCookieStorage](https://www.npmjs.com/package/@partylayer/session)
|
|
@@ -126,3 +126,9 @@ fetchers. The hooks and the UI stay exactly as they are.
|
|
|
126
126
|
- Settle. The venue's trade app exercises its own settle choice, whose body runs
|
|
127
127
|
`Allocation_ExecuteTransfer` for every leg in one transaction. The official Splice
|
|
128
128
|
token-standard trading-app example is the canonical reference for this flow.
|
|
129
|
+
|
|
130
|
+
For the shapes these fetchers pass around, `@partylayer/react/query` exports the
|
|
131
|
+
disclosed contract and choice context types (`TokenDisclosedContract`,
|
|
132
|
+
`TokenChoiceContext`, `TokenTransferFactory`, `TokenAllocationFactory`) plus
|
|
133
|
+
`mergeDisclosedContracts` for combining the disclosures of several registry contexts
|
|
134
|
+
into one submission.
|
|
@@ -123,6 +123,12 @@ the transfer flow against the registry's allocation-instruction factory endpoint
|
|
|
123
123
|
the per-action choice contexts for `Allocation_ExecuteTransfer`, `Allocation_Cancel`,
|
|
124
124
|
and `Allocation_Withdraw`.
|
|
125
125
|
|
|
126
|
+
For the shapes these fetchers pass around, `@partylayer/react/query` exports the
|
|
127
|
+
disclosed contract and choice context types (`TokenDisclosedContract`,
|
|
128
|
+
`TokenChoiceContext`, `TokenTransferFactory`, `TokenAllocationFactory`) plus
|
|
129
|
+
`mergeDisclosedContracts` for combining the disclosures of several registry contexts
|
|
130
|
+
into one submission.
|
|
131
|
+
|
|
126
132
|
Issuer writes (mint, freeze). These are registry-specific admin operations, shown
|
|
127
133
|
here through the generic `useChoice` escape hatch. Real registries typically expose
|
|
128
134
|
issuance through the standard's `BurnMintV1` (`BurnMintFactory_BurnMint`, which
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
-
A [PartyLayer](https://partylayer.xyz) dApp
|
|
3
|
+
A [PartyLayer](https://partylayer.xyz) dApp: React + Vite, with Canton wallet integration.
|
|
4
4
|
|
|
5
5
|
## Develop
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ A [PartyLayer](https://partylayer.xyz) dApp — React + Vite, with Canton wallet
|
|
|
8
8
|
npm run dev
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Open the app and click **Connect Wallet
|
|
11
|
+
Open the app and click **Connect Wallet**. The modal lists every verified Canton wallet from the registry.
|
|
12
12
|
|
|
13
13
|
## How it's wired
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
-
A [PartyLayer](https://partylayer.xyz) dApp
|
|
3
|
+
A [PartyLayer](https://partylayer.xyz) dApp: vanilla TypeScript + Vite, no framework.
|
|
4
4
|
|
|
5
5
|
## Develop
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ client.on('session:disconnected', () => { /* … */ });
|
|
|
22
22
|
const active = await client.getActiveSession(); // restore on load
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`createPartyLayer` is the dApp connect API
|
|
25
|
+
`createPartyLayer` is the dApp connect API, no framework bindings needed. See `src/main.ts` for the full hand-rolled connect UI. Switch networks by changing `network` to `"testnet"` or `"mainnet"`.
|
|
26
26
|
|
|
27
27
|
## Build
|
|
28
28
|
|
|
@@ -9,7 +9,7 @@ const app = document.querySelector<HTMLDivElement>('#app')!;
|
|
|
9
9
|
app.innerHTML = `
|
|
10
10
|
<main class="app">
|
|
11
11
|
<h1>{{PROJECT_NAME}}</h1>
|
|
12
|
-
<p class="subtitle">A PartyLayer dApp on Canton
|
|
12
|
+
<p class="subtitle">A PartyLayer dApp on Canton: vanilla TypeScript, no framework.</p>
|
|
13
13
|
<div id="status" class="status"></div>
|
|
14
14
|
<button id="connect" class="btn">Connect Wallet</button>
|
|
15
15
|
<ul id="wallets" class="wallets" hidden></ul>
|
|
@@ -34,7 +34,7 @@ function renderConnected(session: Session) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function renderDisconnected() {
|
|
37
|
-
statusEl.textContent = 'Not connected
|
|
37
|
+
statusEl.textContent = 'Not connected. Connect a wallet to continue.';
|
|
38
38
|
connectBtn.hidden = false;
|
|
39
39
|
walletsEl.hidden = true;
|
|
40
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{PROJECT_NAME}}
|
|
2
2
|
|
|
3
|
-
A [PartyLayer](https://partylayer.xyz) dApp
|
|
3
|
+
A [PartyLayer](https://partylayer.xyz) dApp: Nuxt 3 + Vue 3 + Pinia, with **SSR session**.
|
|
4
4
|
|
|
5
5
|
## Develop
|
|
6
6
|
|
|
@@ -12,8 +12,8 @@ npm run dev
|
|
|
12
12
|
|
|
13
13
|
- **Server** ([lib/session.ts](lib/session.ts)) reads the session cookie via Nuxt's SSR-aware `useCookie()`, wrapped as a `CookieAdapter` and fed to `@partylayer/session`'s `createCookieStorage` → the connected party renders in the **initial HTML** (no flash). `app.vue` gates on `getServerSession()`.
|
|
14
14
|
- **Client** ([plugins/partylayer.client.ts](plugins/partylayer.client.ts)) creates the PartyLayer client and provides the session store (`createPartyLayerSession`), using `createCookieStorage()` (the same cookie, `document.cookie`).
|
|
15
|
-
- **Pinia** ([stores/session.ts](stores/session.ts)) surfaces the PartyLayer session (`isConnected` / `party` / `status` + `connect`/`disconnect`) as a store
|
|
16
|
-
- Nuxt's cookie API is used only in your app (`lib/session.ts`), never in `@partylayer/session
|
|
15
|
+
- **Pinia** ([stores/session.ts](stores/session.ts)) surfaces the PartyLayer session (`isConnected` / `party` / `status` + `connect`/`disconnect`) as a store. Components read the store. This is the idiomatic "PartyLayer + Pinia" pattern.
|
|
16
|
+
- Nuxt's cookie API is used only in your app (`lib/session.ts`), never in `@partylayer/session`. The library stays framework-agnostic (the same `CookieAdapter` the Next template feeds with `cookies()`).
|
|
17
17
|
|
|
18
18
|
## Build
|
|
19
19
|
|