@markee_team/sdk 0.1.0-alpha.3 → 0.1.0-alpha.5

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.
Files changed (2) hide show
  1. package/README.md +73 -72
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
- # @markee_team/sdk
1
+ # Markee SDK
2
2
 
3
3
  An ESM JavaScript SDK with a self-contained, Shadow DOM modal and an optional React entry point. The SDK knows the Markee API endpoint; the host only supplies its placement and, optionally, its current wallet provider. No Alchemy, Redis, Privy, or bridge-provider key belongs in the consuming app.
4
4
 
5
- This is an experimental `0.1.0-alpha.3` release for wallet-funded For Sale and For Rent flows. Hosted card checkout and incoming cross-chain funding are not included.
5
+ Embed a Markee leaderboard in your app with wallet-funded For Sale and For Rent flows, automatic strategy detection, and a configurable theme. Hosted card checkout and incoming cross-chain funding are not included.
6
6
 
7
- Install the alpha:
7
+ ## Installation
8
8
 
9
9
  ```sh
10
- npm install @markee_team/sdk@alpha
10
+ npm install @markee_team/sdk@latest
11
11
  ```
12
12
 
13
13
  Use React 18 or 19 for the optional React entry point. The plain JavaScript entry point does not require React. Both TypeScript bundler and NodeNext resolution are supported.
@@ -19,6 +19,17 @@ npm ci --prefix packages/sdk
19
19
  npm run build --prefix packages/sdk
20
20
  ```
21
21
 
22
+ ## Create and connect your leaderboard
23
+
24
+ The SDK connects to an existing leaderboard; installing it does not create one.
25
+
26
+ 1. Open [Create a Markee](https://www.markee.xyz/create-a-markee) and complete the leaderboard setup on Markee. Choose For Sale or For Rent there. If you already have a leaderboard, use it instead.
27
+ 2. Copy the resulting Markee page link: `https://www.markee.xyz/markee/<address>`.
28
+ 3. Extract the `0x…` address from that link and use it in the SDK placement: `{ kind: 'board', chainId: 8453, address: yourLeaderboardAddress }`.
29
+ 4. Open the modal to display your leaderboard. If using a coding assistant, give it the Markee page link along with the LLM implementation prompt below.
30
+
31
+ The SDK reads the leaderboard's strategy from Markee and automatically renders the appropriate For Sale or For Rent flow. You do not configure a strategy in your app.
32
+
22
33
  ## Plain JavaScript
23
34
 
24
35
  ```ts
@@ -44,7 +55,7 @@ markee.open({
44
55
  // markee.close();
45
56
  ```
46
57
 
47
- Without a wallet adapter, browsing works without a wallet. On a connect click the modal discovers installed wallets using EIP-6963, with an EIP-1193 fallback. Multiple discovered wallets are offered for explicit selection. An adapter always takes precedence over injected discovery. Hosted login/card checkout is not part of milestones 1–4.
58
+ Without a wallet adapter, browsing works without a wallet. On a connect click the modal discovers installed wallets using EIP-6963, with an EIP-1193 fallback. Multiple discovered wallets are offered for explicit selection. An adapter always takes precedence over injected discovery. Hosted login and card checkout are not supported.
48
59
 
49
60
  ## React
50
61
 
@@ -63,7 +74,7 @@ See [`examples/connectkit`](https://github.com/1Hive/markee/tree/feature/markee-
63
74
 
64
75
  ## Modal layout
65
76
 
66
- Both strategies follow Gardens' For Rent modal: a compact, 512px panel with a fixed header/footer, a collapsible leaderboard, the selected message or editor, and a prominent amount card. The leaderboard pins your loaded messages and offers inline funding selection. Your active rental message is selected when available; otherwise an owned message or the creation form is shown.
77
+ Both strategies use a consistent, compact 512px panel with a fixed header/footer, a collapsible leaderboard, the selected message or editor, and a prominent amount card. The leaderboard pins your loaded messages and offers inline funding selection. Your active rental message is selected when available; otherwise an owned message or the creation form is shown.
67
78
 
68
79
  For Sale uses the same arrangement with a one-time ETH amount. For Rent uses an ETHx monthly rate and links to Deposit manager. Wallet balances, rewards, refunds, edits, and community treasury actions remain accessible without top-level tabs. The footer holds the review/confirmation actions and Stop streaming when applicable.
69
80
 
@@ -135,79 +146,69 @@ Community activation supports the current council Safe, a current Safe owner, or
135
146
  - The modal renders escaped text, uses isolated CSS, and supports keyboard focus, Escape, mobile sizing and reduced motion. A host CSP must permit the SDK's inline styles and connections to its configured Markee API. No external font or image is needed by the modal.
136
147
  - API failures are explicit. Without moderation data, message text is withheld. No mock balances or fabricated rewards are returned by production handlers.
137
148
 
138
- Backend configuration, endpoint details, and verification evidence: [`docs/sdk/implementation.md`](https://github.com/1Hive/markee/blob/feature/markee-sdk/docs/sdk/implementation.md).
149
+ Backend configuration and API reference: [`docs/sdk/implementation.md`](https://github.com/1Hive/markee/blob/feature/markee-sdk/docs/sdk/implementation.md).
139
150
 
140
151
  ## API endpoint
141
152
 
142
- No API URL configuration is required. This alpha uses the Markee staging API at `https://markee-git-feature-markee-sdk-1hive.vercel.app/api/sdk/v1`. For local development or testing only, pass an optional `apiUrl` override to `createMarkee`, `MarkeeClient`, or the React modal. The current default is also exported as `DEFAULT_MARKEE_API_URL`.
153
+ No API URL or Markee API key is required. The SDK connects to the Markee-hosted API and centralizes on-chain reads, metadata, and transaction preparation. For local development or testing, pass an optional `apiUrl` override to `createMarkee`, `MarkeeClient`, or the React modal. The endpoint used by your installed release is exported as `DEFAULT_MARKEE_API_URL`.
143
154
 
144
155
  ## LLM implementation prompt
145
156
 
146
157
  Copy this prompt into your coding assistant. It gathers missing requirements before implementing the integration.
147
158
 
148
159
  ```text
149
- Integrate @markee_team/sdk@0.1.0-alpha.3 into this app. Inspect the app first and
150
- follow its existing framework, styling, and wallet patterns.
151
-
152
- Before changing code, inspect what is already available, then ask me the unanswered
153
- questions below in one concise group. Do not ask again for facts already provided.
154
- Wait for answers about strategy, placement, and intended scope before implementing.
155
-
156
- 1. Do you want For Rent (recurring streaming payments), For Sale (one-time
157
- funding), or both?
158
- 2. Is this a proof of concept or an integration with your own Markee placement?
159
- For your own placement, what are the chain ID and board address, or the Gardens
160
- community address and chain ID? If unknown, ask for the existing Markee/Gardens
161
- link so we can identify and verify the placement. Never invent an address or
162
- assume a board supports the chosen strategy. Offer demo boards only with consent;
163
- explain that they use real Base funds, not a sandbox. If no placement exists,
164
- identify that prerequisite instead of silently substituting a demo board.
165
- 3. Where should Markee appear (page/component), what should open the modal, and
166
- what should the button say? Is the placement fixed or selected per community?
167
- 4. Should we reuse the app's existing connected wallet or use SDK wallet discovery?
168
- Inspect the installed connector first. If a new host wallet connector is needed,
169
- ask which one; do not install ConnectKit automatically.
170
- 5. Should the modal match the app's theme, or use specific light/dark/system mode,
171
- brand colors, font, and corner radius? Suggest the existing app theme by default.
172
- 6. After a confirmed transaction, should the app show a message, refresh data,
173
- navigate, or notify an existing callback? Are there accessibility, mobile, or
174
- framework constraints not evident from the code?
175
-
176
- Explain that this alpha uses a built-in staging API and supports wallet-funded
177
- flows; card checkout and incoming bridging are unavailable. If either is required,
178
- ask whether to proceed with the supported scope instead of promising those features.
179
- Summarize the agreed requirements and implement only the selected flows.
180
-
181
- - Install @markee_team/sdk@0.1.0-alpha.3. The SDK knows its API endpoint. Do not
182
- request an API URL, build an API proxy, or add RPC/database/provider keys.
183
- - For React 18/19, import MarkeeModal from @markee_team/sdk/react in a client
184
- component and supply open, onClose, and placement. For other apps, import
185
- createMarkee from @markee_team/sdk, call createMarkee(), then open({ placement }).
186
- Close the instance on teardown. Reuse the built-in modal UI.
187
- - Use the agreed placement and strategy. Only if I explicitly choose a demo, use
188
- the corresponding existing Base board below (do not add both unless requested):
189
- For Sale: { kind: 'board', chainId: 8453,
190
- address: '0x2768BC6e90266248BD8bCF5401C36D8049CdF671' }
191
- For Rent: { kind: 'board', chainId: 8453,
192
- address: '0x82cbe3BdFC4e01940D186Ac5EA151355647DE0d3' }
193
- - Wallet integration is optional. Reuse the app's selected EIP-1193 provider via
194
- wallet.getProvider(): Promise<provider | null> and optional
195
- wallet.connect(): Promise<provider>. For ConnectKit/wagmi, use the active
196
- connector's provider, resolve connect after selection, and reject cancellation.
197
- Do not create a second wallet context or silently select another injected wallet.
198
- If there is no existing wallet integration, omit wallet for SDK wallet discovery.
199
- - Match the app using theme: mode ('light', 'dark', 'system'), fontFamily, radius,
200
- and semantic colors such as primary and primaryText. Preserve the built-in
201
- layout and its isolated Shadow DOM styles.
202
- - Optionally handle onEvent and show success only for a confirmed event. Let the
203
- SDK handle payment review, chain switching, submission, and verification.
204
- Do not advertise card checkout or incoming bridging: this alpha lacks those
205
- features. The demo boards use real Base funds.
206
- - Run typecheck/build and verify the selected modal flows load without API configuration,
207
- open/close correctly, and match the theme. Verify host wallet reuse if available.
208
- Do not sign or submit transactions during automated verification. Report changed
209
- files, checks, and remaining limitations.
210
-
211
- This alpha automatically uses Markee's temporary staging backend. Read the installed
212
- package README for exact types and configuration details.
160
+ Integrate @markee_team/sdk@latest into this app. Inspect the codebase first and
161
+ follow its existing framework, styling, and wallet patterns. Read the installed
162
+ package README and types for current capabilities.
163
+
164
+ Before implementing, ask me to create my leaderboard on Markee at
165
+ https://www.markee.xyz/create-a-markee, then provide its resulting Markee page link.
166
+ If I already have a leaderboard, ask for that link instead; do not create a duplicate.
167
+ Example link format:
168
+ https://www.markee.xyz/markee/0x6ceBC87DE40519Fa52fc40a1d49f16FF968bb439
169
+ Never silently substitute a demo board. Wait for my link before wiring the placement.
170
+
171
+ Extract the board address from the /markee/<address> path. Validate the Markee URL
172
+ and the address (0x followed by 40 hexadecimal characters). Markee website boards
173
+ currently use Base, chain ID 8453. Verify the board through the SDK snapshot API;
174
+ if verification fails, explain the error and ask for a corrected link.
175
+
176
+ Do not ask me to choose For Sale or For Rent in the host app. That choice is made
177
+ when creating the leaderboard on Markee. The API returns strategy and the SDK
178
+ adapts the modal automatically. Do not add a strategy prop, toggle, or hardcoded mode.
179
+
180
+ Ask only the remaining unanswered requirements in one concise group:
181
+ - Where should Markee appear, what opens the modal, and what should the button say?
182
+ - Should it reuse the app's existing wallet or use SDK wallet discovery? Inspect
183
+ existing connectors first; do not add a second wallet context or install a new
184
+ connector without agreement.
185
+ - Should the modal match the app theme or use specific colors, font, radius, and
186
+ light/dark/system mode?
187
+ - What should happen after a confirmed transaction: notification, refresh,
188
+ navigation, or callback? Are there additional mobile/accessibility requirements?
189
+
190
+ Then implement the agreed scope:
191
+ 1. Install @markee_team/sdk@latest. No API URL or Markee API key is required.
192
+ Do not create an API proxy or add RPC/database credentials.
193
+ 2. Use placement = { kind: 'board', chainId: 8453, address: extractedAddress }.
194
+ Use new MarkeeClient().snapshot(placement) to verify the board and read strategy,
195
+ name, minimum, and other metadata. The modal performs its own snapshot loading;
196
+ do not recreate that loading or strategy logic in the host app.
197
+ 3. For React, use MarkeeModal from @markee_team/sdk/react in a client component
198
+ with open, onClose, and placement. Otherwise use createMarkee() from
199
+ @markee_team/sdk, then open({ placement }); close it on teardown.
200
+ 4. If a host wallet exists, pass its selected EIP-1193 provider through the wallet
201
+ adapter. For ConnectKit/wagmi use the active connector. Resolve connect after
202
+ selection, reject cancellation, and do not silently switch wallet providers.
203
+ Otherwise omit wallet and use SDK wallet discovery.
204
+ 5. Apply theme options while preserving the built-in modal layout. Handle onEvent
205
+ if needed; show success only for a confirmed event. Let the SDK manage review,
206
+ network switching, submission, and verification.
207
+ 6. Verify build/types, loading of the supplied board, automatic strategy selection,
208
+ open/close behavior, theme, and wallet reuse. Do not sign or send transactions
209
+ during automated verification. Report changed files, checks, and limitations.
210
+
211
+ Check the installed release's supported features before promising functionality.
212
+ The SDK supports wallet-funded flows; card checkout and incoming bridging are not
213
+ yet available. Transactions use real funds.
213
214
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markee_team/sdk",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "Self-contained Markee modal and API client, with an optional React adapter.",
5
5
  "type": "module",
6
6
  "sideEffects": false,