@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.
- package/README.md +73 -72
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#
|
|
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
|
-
|
|
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
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
npm install @markee_team/sdk@
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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@
|
|
150
|
-
follow its existing framework, styling, and wallet patterns.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
```
|