@markee_team/sdk 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +189 -45
- package/dist/checkout.d.ts +7 -0
- package/dist/client.d.ts +6 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.js +55 -4
- package/dist/logo-data.d.ts +2 -0
- package/dist/modal.d.ts +7 -0
- package/dist/react.d.ts +13 -1
- package/dist/react.js +55 -4
- package/dist/sign.d.ts +23 -0
- package/dist/styles.d.ts +1 -1
- package/dist/types.d.ts +36 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
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. Eligible Base For Sale boards can also offer Markee-hosted card checkout when enabled by Markee. Incoming cross-chain funding is not included.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The package also includes a standalone **Markee sign button**. It shows the board's current winner, follows Markee's moderation decisions, and opens the payment modal when clicked.
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
8
10
|
|
|
9
11
|
```sh
|
|
10
|
-
npm install @markee_team/sdk@
|
|
12
|
+
npm install @markee_team/sdk@latest
|
|
11
13
|
```
|
|
12
14
|
|
|
13
15
|
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 +21,31 @@ npm ci --prefix packages/sdk
|
|
|
19
21
|
npm run build --prefix packages/sdk
|
|
20
22
|
```
|
|
21
23
|
|
|
24
|
+
## Create and connect your leaderboard
|
|
25
|
+
|
|
26
|
+
The SDK connects to an existing leaderboard; installing it does not create one.
|
|
27
|
+
|
|
28
|
+
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.
|
|
29
|
+
2. Copy the resulting Markee page link: `https://www.markee.xyz/markee/<address>`.
|
|
30
|
+
3. Extract the `0x…` address from that link and use it in the SDK placement: `{ kind: 'board', chainId: 8453, address: yourLeaderboardAddress }`.
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
## Automatic site verification
|
|
36
|
+
|
|
37
|
+
Pass your public page URL or domain as `siteUrl` to `MarkeeModal` or `createMarkee`, for example `siteUrl="https://your-app.example"`. The React component registers the site when mounted, even while closed; the JavaScript modal registers when opened. No API key is required. Use `onSiteVerification` to inspect success or setup errors; verification does not block browsing or payments.
|
|
38
|
+
|
|
39
|
+
Markee fetches the public page and verifies that its HTML contains the matching board marker before adding it to **Served on**. The React component renders this marker for server-rendered apps. For client-rendered apps such as Vite, include it in the deployed `index.html` (replace the address with your board):
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<span hidden data-markee-address="0xYOUR_BOARD_ADDRESS"></span>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The marker must be present in the HTML returned by the server, not only injected by JavaScript. The supplied URL must use HTTPS, match the app's origin, and return the final HTML page without redirects. Localhost and private-network sites cannot be publicly verified. Registration currently supports Base boards. It verifies the board's presence, not legal domain ownership.
|
|
46
|
+
|
|
47
|
+
For an explicit retry after deployment, call `new MarkeeClient().verifySite(placement, siteUrl)`. The endpoint is `POST /api/sdk/v1/sites/verify` with `{ placement, siteUrl }`. Unverified sites are never added to the verified list.
|
|
48
|
+
|
|
22
49
|
## Plain JavaScript
|
|
23
50
|
|
|
24
51
|
```ts
|
|
@@ -44,7 +71,7 @@ markee.open({
|
|
|
44
71
|
// markee.close();
|
|
45
72
|
```
|
|
46
73
|
|
|
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.
|
|
74
|
+
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. Eligible boards also offer hosted login and card checkout when enabled by Markee; the host app does not need its own wallet integration.
|
|
48
75
|
|
|
49
76
|
## React
|
|
50
77
|
|
|
@@ -61,9 +88,24 @@ import { MarkeeModal } from '@markee_team/sdk/react';
|
|
|
61
88
|
|
|
62
89
|
See [`examples/connectkit`](https://github.com/1Hive/markee/tree/feature/markee-sdk/examples/connectkit) for a complete adapter. Its connection promise resolves only once ConnectKit has selected a provider and rejects when the picker is dismissed. The SDK does not install a second wallet context.
|
|
63
90
|
|
|
91
|
+
## Embed the current Markee sign
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { MarkeeSign } from '@markee_team/sdk/react';
|
|
95
|
+
|
|
96
|
+
const placement = { kind: 'board', chainId: 8453, address: '0x2768BC6e90266248BD8bCF5401C36D8049CdF671' } as const;
|
|
97
|
+
<MarkeeSign placement={placement} theme={{ mode: 'dark' }} />;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`MarkeeSign` is a compact, clickable sign with the winner's message, view count, and a suggested monthly rate on For Rent boards. By default, clicking it opens the SDK modal. Pass `onOpen={() => setOpen(true)}` to open your own controlled `MarkeeModal` instead, or `showAction={false}` to render a non-clickable sign. The sign and modal accept separate `theme` values. No app-side moderation database, RPC key, or moderation provider is needed. To render from plain JavaScript, call `createMarkeeSign(containerElement, { placement })`; its return value has `refresh()`, `setTheme()`, and `destroy()`.
|
|
101
|
+
|
|
102
|
+
The sign fades in the real MARKEE logo behind the message on hover and keyboard focus, following the Gardens sign treatment. It selects the light or dark logo with the sign's theme, including system-mode changes. Set `theme={{ mode: 'dark', sign: { hoverLogo: false } }}` to disable the watermark. `sign.hoverBackground` remains available for an optional hover surface color; otherwise the sign keeps its normal surface. These options apply only to the sign, so the modal can use its own theme.
|
|
103
|
+
|
|
104
|
+
The SDK snapshot API reads **board moderation flags** from Markee's database. A flagged winner is blurred with a notice. The sign does not offer a reveal action or count a view for flagged content. If moderation data cannot be loaded, it withholds the message until the status is known. Visible, unflagged signs record one view per message. The sign refreshes every 30 seconds while mounted and can be refreshed on demand. Markee-only site flags intentionally apply only on markee.xyz; they do not censor a partner's embedded sign. Moderators still manage flags on Markee; moderation writes invalidate SDK snapshots so embedded signs can pick up changes on their next refresh.
|
|
105
|
+
|
|
64
106
|
## Modal layout
|
|
65
107
|
|
|
66
|
-
Both strategies
|
|
108
|
+
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
109
|
|
|
68
110
|
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
111
|
|
|
@@ -79,7 +121,9 @@ import { createMarkee, type MarkeeTheme } from '@markee_team/sdk';
|
|
|
79
121
|
const theme: MarkeeTheme = {
|
|
80
122
|
mode: 'system',
|
|
81
123
|
fontFamily: '"DM Sans", system-ui, sans-serif',
|
|
82
|
-
radius:
|
|
124
|
+
radius: 16,
|
|
125
|
+
cardRadius: 12,
|
|
126
|
+
controlRadius: 8,
|
|
83
127
|
colors: {
|
|
84
128
|
primary: '#743a84',
|
|
85
129
|
primaryText: '#ffffff',
|
|
@@ -101,11 +145,17 @@ Theme changes update styles in place: drafts, focus, scroll, wallet sessions, an
|
|
|
101
145
|
| --- | --- |
|
|
102
146
|
| `mode` | `light`, `dark`, or `system` |
|
|
103
147
|
| `fontFamily` | CSS font stack; the app supplies any custom font |
|
|
104
|
-
| `radius` | Panel radius in pixels, 0–48 (default 22)
|
|
148
|
+
| `radius` | Panel radius in pixels, 0–48 (default 22) |
|
|
149
|
+
| `cardRadius` | Card radius in pixels, 0–48; defaults to 64% of panel radius |
|
|
150
|
+
| `controlRadius` | Button and input radius in pixels, 0–48; defaults to 45% of panel radius |
|
|
105
151
|
| `colors` | Partial overrides for the semantic tokens below |
|
|
152
|
+
| `sign.hoverLogo` | Show the theme-matched MARKEE logo on hover/focus (default `true`) |
|
|
153
|
+
| `sign.hoverBackground` | Optional sign hover surface color; defaults to the normal surface |
|
|
106
154
|
|
|
107
155
|
Color tokens: `background`, `surface`, `text`, `muted`, `border`, `inputBackground`, `inputText`, `primary`, `primaryText`, `accent`, `accentText`, `accentSurface`, `accentSurfaceText`, `accentBorder`, `selected`, `selectedText`, `info`, `infoText`, `error`, `errorText`, `success`, `successText`, `link`, `focusRing`, and `overlay`. Set foreground/background pairs together and check your brand's contrast in both modes. Overrides apply over either selected palette; omitted values use that palette's defaults. Invalid CSS color/font values fall back to defaults.
|
|
108
156
|
|
|
157
|
+
To match an app completely, override `link`, `focusRing`, `border`, `selected`/`selectedText`, and the accent colors as well as the primary button colors. Otherwise those elements retain the SDK palette. Use the typed theme options; arbitrary custom CSS is not currently supported. The sign’s price badge appears on hover or keyboard focus, and stays visible on touch devices.
|
|
158
|
+
|
|
109
159
|
Styles are scoped to the modal's Shadow DOM and do not change the host app or its wallet picker. The ConnectKit sample includes light, dark, device, and custom Plum presets.
|
|
110
160
|
|
|
111
161
|
## Headless API
|
|
@@ -125,6 +175,14 @@ For Sale supports create/fund/edit. New message ownership belongs to the caller.
|
|
|
125
175
|
|
|
126
176
|
For Rent supports message creation, starting/updating/switching/stopping a stream, wrap/unwrap, pool connection/refunds, board-buffer recovery, ranking refresh and settlement. The server builds the complete Superfluid batch, including exact ETHx approval and pool connection. Wallet runway uses the combined CFA and GDA net flow across the wallet, not only the current board. Rental MARKEE comes from actual settled rent, never merely from wrapping or depositing ETH.
|
|
127
177
|
|
|
178
|
+
Payment reviews remain visible while the wallet requests confirmation, including network switches. If a review expires when confirming, the modal shows **Refreshing payment details…**, prepares an updated review, and requires another confirmation click. It never automatically sends the refreshed transaction.
|
|
179
|
+
|
|
180
|
+
For Sale reviews are disabled when the entered payment exceeds the loaded ETH balance; the balance uses the error color and the button explains the shortfall. The API also checks network fees before wallet confirmation.
|
|
181
|
+
|
|
182
|
+
For Rent reviews show estimated **MARKEE/month while winning**, using the selected monthly stream rate and current on-chain reward settings. The estimate is not based on the ETH deposit and is not guaranteed; if quoting is unavailable, the modal shows a qualitative reward description. Rental transaction details contain only Network, Recipient, and Wallet; fees stay in the payment summary.
|
|
183
|
+
|
|
184
|
+
Refunds flow automatically when connected to the message’s refund pool. **Collect refund** appears only when the loaded wallet snapshot reports a positive claimable balance for that message’s pool. Board-buffer recovery is separate. Community revenue actions are accessed through **Community accumulated revenue**.
|
|
185
|
+
|
|
128
186
|
Community activation supports the current council Safe, a current Safe owner, or the configured authorized keeper. Revenue claims support the current Safe or its current owners and always pay the council treasury. Existing outbound Across, Squid and LI.FI routing lives on Markee's server.
|
|
129
187
|
|
|
130
188
|
## Integration boundaries
|
|
@@ -135,49 +193,135 @@ Community activation supports the current council Safe, a current Safe owner, or
|
|
|
135
193
|
- 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
194
|
- API failures are explicit. Without moderation data, message text is withheld. No mock balances or fabricated rewards are returned by production handlers.
|
|
137
195
|
|
|
138
|
-
Backend configuration
|
|
196
|
+
Backend configuration and API reference: [`docs/sdk/implementation.md`](https://github.com/1Hive/markee/blob/feature/markee-sdk/docs/sdk/implementation.md).
|
|
139
197
|
|
|
140
198
|
## API endpoint
|
|
141
199
|
|
|
142
|
-
No API URL
|
|
200
|
+
No API URL or Markee API key is required. The SDK default is:
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
https://staging.markee.xyz/api/sdk/v1
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Markee hosts this API and centralizes on-chain reads, metadata, and transaction preparation. Staging does not imply test funds: Base placements use real funds. 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
207
|
|
|
144
208
|
## LLM implementation prompt
|
|
145
209
|
|
|
146
|
-
Copy this prompt into your coding assistant.
|
|
210
|
+
Copy this prompt into your coding assistant. It gathers missing requirements before implementing the integration.
|
|
147
211
|
|
|
148
212
|
```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
|
-
|
|
213
|
+
Integrate @markee_team/sdk@latest into this app. Inspect the codebase first and
|
|
214
|
+
follow its existing framework, styling, and wallet patterns. Read the installed
|
|
215
|
+
package README and types for current capabilities.
|
|
216
|
+
|
|
217
|
+
Before implementing, ask me to create my leaderboard on Markee at
|
|
218
|
+
https://www.markee.xyz/create-a-markee, then provide its resulting Markee page link.
|
|
219
|
+
If I already have a leaderboard, ask for that link instead; do not create a duplicate.
|
|
220
|
+
Example link format:
|
|
221
|
+
https://www.markee.xyz/markee/0x6ceBC87DE40519Fa52fc40a1d49f16FF968bb439
|
|
222
|
+
Never silently substitute a demo board. Wait for my link before wiring the placement.
|
|
223
|
+
|
|
224
|
+
Extract the board address from the /markee/<address> path. Validate the Markee URL
|
|
225
|
+
and the address (0x followed by 40 hexadecimal characters). Markee website boards
|
|
226
|
+
currently use Base, chain ID 8453. Verify the board through the SDK snapshot API;
|
|
227
|
+
if verification fails, explain the error and ask for a corrected link.
|
|
228
|
+
|
|
229
|
+
Do not ask me to choose For Sale or For Rent in the host app. That choice is made
|
|
230
|
+
when creating the leaderboard on Markee. The API returns strategy and the SDK
|
|
231
|
+
adapts the modal automatically. Do not add a strategy prop, toggle, or hardcoded mode.
|
|
232
|
+
|
|
233
|
+
Ask only the remaining unanswered requirements in one concise group:
|
|
234
|
+
- Where should Markee appear, what opens the modal, and what should the button say?
|
|
235
|
+
- Should it reuse the app's existing wallet, use SDK wallet discovery, or use
|
|
236
|
+
Markee-hosted card checkout without an app wallet (For Sale on Base only)? Inspect
|
|
237
|
+
existing connectors first; do not add a second wallet context or install a new
|
|
238
|
+
connector without agreement.
|
|
239
|
+
- Should the modal match the app theme or use specific colors, font, panel/card/
|
|
240
|
+
control radii, and light/dark/system mode? Include links, focus rings, borders,
|
|
241
|
+
and selected states when matching the host palette.
|
|
242
|
+
- What public domain/page will host this integration? Use it as siteUrl for
|
|
243
|
+
automatic verification. For Vite/client rendering, add the board marker to the
|
|
244
|
+
static HTML as documented; do not claim localhost is verified.
|
|
245
|
+
- What should happen after a confirmed transaction: notification, refresh,
|
|
246
|
+
navigation, or callback? Are there additional mobile/accessibility requirements?
|
|
247
|
+
|
|
248
|
+
Then implement the agreed scope:
|
|
249
|
+
1. Install @markee_team/sdk@latest. No API URL or Markee API key is required.
|
|
250
|
+
Do not create an API proxy or add RPC/database credentials.
|
|
251
|
+
2. Use placement = { kind: 'board', chainId: 8453, address: extractedAddress }.
|
|
252
|
+
Use new MarkeeClient().snapshot(placement) to verify the board and read strategy,
|
|
253
|
+
name, minimum, and other metadata. The modal performs its own snapshot loading;
|
|
254
|
+
do not recreate that loading or strategy logic in the host app.
|
|
255
|
+
3. For React, use MarkeeModal from @markee_team/sdk/react in a client component
|
|
256
|
+
with open, onClose, and placement. Otherwise use createMarkee() from
|
|
257
|
+
@markee_team/sdk, then open({ placement }); close it on teardown.
|
|
258
|
+
4. If a host wallet exists, pass its selected EIP-1193 provider through the wallet
|
|
259
|
+
adapter. For ConnectKit/wagmi use the active connector. Resolve connect after
|
|
260
|
+
selection, reject cancellation, and do not silently switch wallet providers.
|
|
261
|
+
Otherwise omit wallet. Without a connected app account, the modal shows only
|
|
262
|
+
Pay, opening Markee-hosted checkout for supported boards. Do not install
|
|
263
|
+
Privy or collect card details in the host app.
|
|
264
|
+
5. Apply theme options (including radius, cardRadius, and controlRadius) while
|
|
265
|
+
preserving the built-in modal layout. Handle onEvent
|
|
266
|
+
if needed; show success only for a confirmed event. Let the SDK manage review,
|
|
267
|
+
network switching, submission, and verification.
|
|
268
|
+
6. Verify build/types, loading of the supplied board, automatic strategy selection,
|
|
269
|
+
open/close behavior, theme, and wallet reuse. Do not sign or send transactions
|
|
270
|
+
during automated verification. Report changed files, checks, and limitations.
|
|
271
|
+
|
|
272
|
+
Check the installed release's supported features before promising functionality.
|
|
273
|
+
Wallet-funded flows are supported. Hosted card checkout requires Markee's backend
|
|
274
|
+
capability to be enabled; do not promise availability when it is disabled. Incoming
|
|
275
|
+
bridging is not available. Transactions and card funding use real funds.
|
|
183
276
|
```
|
|
277
|
+
|
|
278
|
+
## Pay by card without an app wallet
|
|
279
|
+
|
|
280
|
+
Without a connected app wallet, the modal shows **Pay** as its only payment action
|
|
281
|
+
and hides wallet balances and wallet-management sections. For Sale boards on Base
|
|
282
|
+
with MARKEE rewards support this flow
|
|
283
|
+
when the Markee backend enables hosted checkout. No Privy provider, payment keys or
|
|
284
|
+
API configuration is needed in the integrating app. Omit the `wallet` adapter.
|
|
285
|
+
|
|
286
|
+
The SDK opens Markee, where the user signs in, receives a Privy embedded wallet,
|
|
287
|
+
funds it through Stripe (Base USDC converted to ETH) or MoonPay (Base ETH), and confirms
|
|
288
|
+
the Markee payment. The contract sends MARKEE directly to that user's paying
|
|
289
|
+
wallet. The host receives `onEvent({ type: 'confirmed', hash })` only after
|
|
290
|
+
server-side receipt verification. Card funding alone is not a successful payment.
|
|
291
|
+
|
|
292
|
+
The checkout can resume after closing or refreshing. If a wallet submission has an
|
|
293
|
+
unknown result, it asks the user to check the existing transaction instead of
|
|
294
|
+
sending again. On browsers that block popups, it navigates to Markee in the same
|
|
295
|
+
tab. Reopen Pay after returning to recover the confirmed result.
|
|
296
|
+
|
|
297
|
+
Card availability, fees, minimum purchase amounts and identity checks depend on
|
|
298
|
+
the funding provider and user eligibility. Any unused USDC or ETH remains in the
|
|
299
|
+
user's wallet. Conversion uses a capped approval and maximum 1% slippage, with
|
|
300
|
+
wallet confirmation and Markee-sponsored conversion gas. For Rent, incoming
|
|
301
|
+
bridging and automatic rewards forwarding to a different wallet are outside this
|
|
302
|
+
checkout flow. If hosted checkout is unavailable, Pay is disabled with an
|
|
303
|
+
availability message; the modal does not fall back to asking for a wallet.
|
|
304
|
+
|
|
305
|
+
### Reuse a Markee login
|
|
306
|
+
|
|
307
|
+
Pay opens a temporary browser tab on Markee, where the existing Privy session is
|
|
308
|
+
restored before showing sign-in. The SDK does not copy login tokens into the host
|
|
309
|
+
app. The tab closes after the host verifies the payment. If tabs are blocked,
|
|
310
|
+
checkout falls back to a same-tab redirect. To always redirect, pass
|
|
311
|
+
`checkoutWindow: 'redirect'` (`checkoutWindow="redirect"` in React).
|
|
312
|
+
|
|
313
|
+
Session reuse requires the same exact Markee origin and Privy app ID. A login on
|
|
314
|
+
`www.markee.xyz` is not a login on a Vercel preview domain. Markee can set
|
|
315
|
+
`MARKEE_CHECKOUT_ORIGIN=https://www.markee.xyz` on its API deployment **after** the
|
|
316
|
+
checkout route is deployed there. Both deployments must use the same checkout KV,
|
|
317
|
+
signing secret, supported configuration and Privy app. Omit this setting to keep
|
|
318
|
+
checkout on the API origin. Integrators do not configure an API or checkout URL.
|
|
319
|
+
Existing pending checkout sessions retain their original destination.
|
|
320
|
+
|
|
321
|
+
### Pay in Markee availability
|
|
322
|
+
|
|
323
|
+
The SDK checks the Markee API before offering hosted payment. Markee controls this
|
|
324
|
+
feature with the server-only `FLAG_SDK_PAY_IN_MARKEE` environment variable, which
|
|
325
|
+
defaults to false. Only `true`, together with the required checkout configuration,
|
|
326
|
+
enables it. Integrating apps do not need to provide a flag or API key. Connected
|
|
327
|
+
wallet payments remain available independently.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type MarkeeClient } from './client.js';
|
|
2
|
+
import type { Action, CheckoutSession, CheckoutStatus, Placement, TransactionResult } from './types.js';
|
|
3
|
+
export declare function savedCheckout(client: MarkeeClient, placement: Placement): CheckoutSession | null;
|
|
4
|
+
export declare function checkoutStatus(client: MarkeeClient, session: CheckoutSession): Promise<CheckoutStatus>;
|
|
5
|
+
export declare function forgetCheckout(client: MarkeeClient, placement: Placement): void;
|
|
6
|
+
/** Call directly from a click handler to preserve popup permission. */
|
|
7
|
+
export declare function openHostedCheckout(client: MarkeeClient, placement: Placement, action: Action): Promise<TransactionResult>;
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Action, Address, AdminOperation, AdminResult, Authorization, BridgeStatus, ClaimQuote, EIP1193Provider, Hex, Placement, PreparedAction, SDKOptions, Snapshot, TransactionResult } from './types.js';
|
|
2
|
-
/** Markee-hosted API for
|
|
3
|
-
export declare const DEFAULT_MARKEE_API_URL = "https://markee
|
|
1
|
+
import type { Action, Address, AdminOperation, AdminResult, Authorization, BridgeStatus, ClaimQuote, EIP1193Provider, Hex, Placement, PreparedAction, SDKOptions, Snapshot, SiteVerification, TransactionResult } from './types.js';
|
|
2
|
+
/** Markee-hosted API used by integrations unless overridden for local development. */
|
|
3
|
+
export declare const DEFAULT_MARKEE_API_URL = "https://staging.markee.xyz/api/sdk/v1";
|
|
4
4
|
export declare class MarkeeError extends Error {
|
|
5
5
|
code: string;
|
|
6
6
|
status?: number | undefined;
|
|
@@ -38,6 +38,9 @@ export declare class MarkeeClient {
|
|
|
38
38
|
provider(): Promise<EIP1193Provider | null>;
|
|
39
39
|
account(): Promise<Address | null>;
|
|
40
40
|
connect(selected?: EIP1193Provider): Promise<Address>;
|
|
41
|
+
verifySite(placement: Placement, siteUrl: string): Promise<SiteVerification>;
|
|
42
|
+
private siteRequests;
|
|
43
|
+
registerSite(placement: Placement): void;
|
|
41
44
|
snapshot(placement: Placement, account?: Address | null, offset?: number, signal?: AbortSignal): Promise<Snapshot>;
|
|
42
45
|
prepare(placement: Placement, action: Action): Promise<PreparedAction>;
|
|
43
46
|
private ensureWallet;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,3 +4,6 @@ export type { PendingTransaction, DiscoveredWallet } from './client.js';
|
|
|
4
4
|
export { createMarkee, MarkeeModal } from './modal.js';
|
|
5
5
|
export type { ModalOptions } from './modal.js';
|
|
6
6
|
export { parseEth, formatEth } from './amount.js';
|
|
7
|
+
export { openHostedCheckout, checkoutStatus, savedCheckout } from './checkout.js';
|
|
8
|
+
export { createMarkeeSign, signContent } from './sign.js';
|
|
9
|
+
export type { MarkeeSignOptions } from './sign.js';
|