@markee_team/sdk 0.1.0-alpha.4 → 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 +21 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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
10
|
npm install @markee_team/sdk@latest
|
|
@@ -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,11 +146,11 @@ 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
|
|
|
@@ -197,7 +208,7 @@ Then implement the agreed scope:
|
|
|
197
208
|
open/close behavior, theme, and wallet reuse. Do not sign or send transactions
|
|
198
209
|
during automated verification. Report changed files, checks, and limitations.
|
|
199
210
|
|
|
200
|
-
Check the installed release's
|
|
201
|
-
|
|
202
|
-
|
|
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.
|
|
203
214
|
```
|