@orangecheck/me-client 0.30.1 → 0.32.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/dist/index.mjs CHANGED
@@ -1,6 +1,3 @@
1
- import * as React from 'react';
2
- import { jsxs, jsx } from 'react/jsx-runtime';
3
-
4
1
  var __defProp = Object.defineProperty;
5
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -157,75 +154,6 @@ async function invalidate(sessionId) {
157
154
  });
158
155
  }
159
156
  var session = { create, refresh, invalidate };
160
- function OcSignInButton({
161
- scope: scope2,
162
- sessionPolicy,
163
- returnTo,
164
- onSignin,
165
- onSignInError,
166
- label = "sign in with oc",
167
- children,
168
- onClick,
169
- style,
170
- ...rest
171
- }) {
172
- const [pending, setPending] = React.useState(false);
173
- return /* @__PURE__ */ jsxs(
174
- "button",
175
- {
176
- type: "button",
177
- onClick: async (event2) => {
178
- onClick?.(event2);
179
- if (event2.defaultPrevented) return;
180
- setPending(true);
181
- try {
182
- const result = await session.create({ scope: scope2, sessionPolicy, returnTo });
183
- onSignin?.(result);
184
- } catch (err) {
185
- onSignInError?.(err instanceof Error ? err : new Error(String(err)));
186
- } finally {
187
- setPending(false);
188
- }
189
- },
190
- style: {
191
- display: "inline-flex",
192
- alignItems: "center",
193
- gap: 8,
194
- padding: "10px 16px",
195
- fontSize: 13,
196
- fontWeight: 600,
197
- fontFamily: 'ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace',
198
- letterSpacing: "0.18em",
199
- textTransform: "uppercase",
200
- background: "#f97316",
201
- color: "#0b0909",
202
- border: "1px solid #f97316",
203
- borderRadius: 4,
204
- cursor: pending ? "progress" : "pointer",
205
- opacity: pending ? 0.7 : 1,
206
- ...style ?? {}
207
- },
208
- disabled: pending || rest.disabled,
209
- "data-oc-signin": true,
210
- ...rest,
211
- children: [
212
- /* @__PURE__ */ jsx(
213
- "span",
214
- {
215
- "aria-hidden": true,
216
- style: {
217
- display: "inline-block",
218
- width: 12,
219
- height: 12,
220
- background: "#0b0909"
221
- }
222
- }
223
- ),
224
- children ?? (pending ? "opening\u2026" : label)
225
- ]
226
- }
227
- );
228
- }
229
157
 
230
158
  // src/payment.ts
231
159
  async function authorize(opts) {
@@ -525,143 +453,143 @@ var ARCHETYPE_TEMPLATES = [
525
453
  {
526
454
  id: "saas-paywall",
527
455
  label: "SaaS \xB7 paywall",
528
- summary: "Subscription product \xB7 users sign up, sign in, sometimes pay for premium tiers. Default cashback to encourage signup + retention.",
529
- examples: ["Notion-like notes app", "Linear-like project tracker", "Figma-like editor"],
456
+ summary: "A subscription product: people sign up, sign in and sometimes pay for more. Pays them for signing up and coming back.",
457
+ examples: ["notes app", "project tracker", "design editor"],
530
458
  events: {
531
459
  account_creation: {
532
460
  enabled: true,
533
- site_pays: FIXED(1300),
534
- user_share_pct: 0.65
461
+ site_pays: FIXED(1056),
462
+ user_share_pct: 0.8
535
463
  },
536
464
  session_creation: {
537
465
  enabled: true,
538
- site_pays: FIXED(55),
539
- user_share_pct: 0.65
466
+ site_pays: FIXED(45),
467
+ user_share_pct: 0.8
540
468
  },
541
469
  payment_authorization: {
542
470
  enabled: true,
543
- site_pays: PCT(75e-4),
544
- user_share_pct: 0.65
471
+ site_pays: PCT(609375e-8),
472
+ user_share_pct: 0.8
545
473
  },
546
474
  payment_method_connected: {
547
475
  enabled: true,
548
- site_pays: FIXED(320),
549
- user_share_pct: 0.65
476
+ site_pays: FIXED(260),
477
+ user_share_pct: 0.8
550
478
  }
551
479
  }
552
480
  },
553
481
  {
554
482
  id: "marketplace",
555
483
  label: "marketplace",
556
- summary: "Two-sided marketplace \xB7 buyers + sellers transact. Heavy on payment_authorization and scoped_action_authorization for listings.",
557
- examples: ["Stripe-like checkout", "Etsy-like marketplace", "Uber-like ride-hailing"],
484
+ summary: "Buyers and sellers trade. Pays on payments, listings and new payment methods.",
485
+ examples: ["checkout", "handmade-goods market", "ride-hailing"],
558
486
  events: {
559
487
  account_creation: {
560
488
  enabled: true,
561
- site_pays: FIXED(1300),
562
- user_share_pct: 0.65
489
+ site_pays: FIXED(1056),
490
+ user_share_pct: 0.8
563
491
  },
564
492
  session_creation: {
565
493
  enabled: true,
566
- site_pays: FIXED(55),
567
- user_share_pct: 0.65
494
+ site_pays: FIXED(45),
495
+ user_share_pct: 0.8
568
496
  },
569
497
  payment_authorization: {
570
498
  enabled: true,
571
- site_pays: PCT(75e-4),
572
- user_share_pct: 0.65
499
+ site_pays: PCT(609375e-8),
500
+ user_share_pct: 0.8
573
501
  },
574
502
  scoped_action_authorization: {
575
503
  enabled: true,
576
- site_pays: FIXED(100),
577
- user_share_pct: 0.65
504
+ site_pays: FIXED(81),
505
+ user_share_pct: 0.8
578
506
  },
579
507
  payment_method_connected: {
580
508
  enabled: true,
581
- site_pays: FIXED(320),
582
- user_share_pct: 0.65
509
+ site_pays: FIXED(260),
510
+ user_share_pct: 0.8
583
511
  },
584
512
  attest_verification_at_gate: {
585
513
  enabled: true,
586
- site_pays: FIXED(280),
587
- user_share_pct: 0.65
514
+ site_pays: FIXED(227),
515
+ user_share_pct: 0.8
588
516
  }
589
517
  }
590
518
  },
591
519
  {
592
520
  id: "content-platform",
593
521
  label: "content platform",
594
- summary: "User-generated content \xB7 posts, reviews, votes, comments. Each meaningful action is scoped_action_authorization; stamp_signing for credentialed reviews.",
595
- examples: ["Reddit-like forum", "YouTube-like video host", "Substack-like publishing"],
522
+ summary: "Posts, reviews, votes and comments. Pays for each meaningful action, and for signed reviews.",
523
+ examples: ["forum", "video host", "newsletter"],
596
524
  events: {
597
525
  account_creation: {
598
526
  enabled: true,
599
- site_pays: FIXED(1300),
600
- user_share_pct: 0.7
527
+ site_pays: FIXED(1137),
528
+ user_share_pct: 0.8
601
529
  },
602
530
  session_creation: {
603
531
  enabled: true,
604
- site_pays: FIXED(55),
605
- user_share_pct: 0.7
532
+ site_pays: FIXED(49),
533
+ user_share_pct: 0.8
606
534
  },
607
535
  scoped_action_authorization: {
608
536
  enabled: true,
609
- site_pays: FIXED(100),
610
- user_share_pct: 0.7
537
+ site_pays: FIXED(87),
538
+ user_share_pct: 0.8
611
539
  },
612
540
  stamp_signing: {
613
541
  enabled: true,
614
- site_pays: FIXED(55),
615
- user_share_pct: 0.7
542
+ site_pays: FIXED(49),
543
+ user_share_pct: 0.8
616
544
  }
617
545
  }
618
546
  },
619
547
  {
620
548
  id: "gaming",
621
549
  label: "gaming",
622
- summary: "Game with monetized actions \xB7 pledges + scoped actions are core. Higher cashback ratios reward in-game engagement.",
550
+ summary: "A game where actions carry value. Pays for playing, paying and settled pledges.",
623
551
  examples: [
624
552
  "on-chain prediction markets",
625
553
  "skill-staking tournaments",
626
- "PvP wager games"
554
+ "multiplayer games"
627
555
  ],
628
556
  events: {
629
557
  account_creation: {
630
558
  enabled: true,
631
- site_pays: FIXED(1300),
632
- user_share_pct: 0.7
559
+ site_pays: FIXED(1137),
560
+ user_share_pct: 0.8
633
561
  },
634
562
  session_creation: {
635
563
  enabled: true,
636
- site_pays: FIXED(55),
637
- user_share_pct: 0.7
564
+ site_pays: FIXED(49),
565
+ user_share_pct: 0.8
638
566
  },
639
567
  scoped_action_authorization: {
640
568
  enabled: true,
641
- site_pays: FIXED(100),
642
- user_share_pct: 0.7
569
+ site_pays: FIXED(87),
570
+ user_share_pct: 0.8
643
571
  },
644
572
  payment_authorization: {
645
573
  enabled: true,
646
- site_pays: PCT(5e-3),
647
- user_share_pct: 0.7
574
+ site_pays: PCT(4375e-6),
575
+ user_share_pct: 0.8
648
576
  },
649
577
  pledge_resolution: {
650
578
  enabled: true,
651
- site_pays: PCT(0.01),
652
- user_share_pct: 0.7
579
+ site_pays: PCT(875e-5),
580
+ user_share_pct: 0.8
653
581
  },
654
582
  attest_verification_at_gate: {
655
583
  enabled: true,
656
- site_pays: FIXED(280),
657
- user_share_pct: 0.7
584
+ site_pays: FIXED(245),
585
+ user_share_pct: 0.8
658
586
  }
659
587
  }
660
588
  },
661
589
  {
662
590
  id: "agent-only",
663
591
  label: "agent-only",
664
- summary: "AI-agent surface \xB7 oc-agent delegations are the primary auth pattern. Session_creation off (delegations replace sessions); agent_delegation_issued + scoped_action_authorization carry the activity.",
592
+ summary: "AI agents act for people under a delegation. Sessions are off; delegations and the actions they allow carry the activity.",
665
593
  examples: [
666
594
  "AI assistant calling APIs on user behalf",
667
595
  "autonomous trading bot",
@@ -670,18 +598,18 @@ var ARCHETYPE_TEMPLATES = [
670
598
  events: {
671
599
  account_creation: {
672
600
  enabled: true,
673
- site_pays: FIXED(1300),
674
- user_share_pct: 0.65
601
+ site_pays: FIXED(1056),
602
+ user_share_pct: 0.8
675
603
  },
676
604
  agent_delegation_issued: {
677
605
  enabled: true,
678
- site_pays: FIXED(320),
679
- user_share_pct: 0.65
606
+ site_pays: FIXED(260),
607
+ user_share_pct: 0.8
680
608
  },
681
609
  scoped_action_authorization: {
682
610
  enabled: true,
683
- site_pays: FIXED(100),
684
- user_share_pct: 0.65
611
+ site_pays: FIXED(81),
612
+ user_share_pct: 0.8
685
613
  }
686
614
  }
687
615
  }
@@ -706,7 +634,7 @@ var ALL_SUBTYPES = [
706
634
  var DEFAULT_DISABLED = {
707
635
  enabled: false,
708
636
  site_pays: { kind: "fixed_sats", sats: 100 },
709
- user_share_pct: 0.65
637
+ user_share_pct: 0.8
710
638
  };
711
639
  function fromTemplate(useCase, identity2) {
712
640
  const template = ARCHETYPES_BY_ID[useCase];
@@ -1557,6 +1485,6 @@ var oc = {
1557
1485
  identity
1558
1486
  };
1559
1487
 
1560
- export { ALL_EVENT_SUBTYPES, ARCHETYPE_TEMPLATES, EVENT_SUBTYPES, MAX_DROP_WINDOW_DAYS, MIN_INTEGRATOR_PRICE_SATS, MeClientError, OcSignInButton, PLATFORM_FEE_POLICY, clearBearerToken, computeFees, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, identity, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, subtypesForClass, validateIntegratorConfig, verifyActivityAttestation, webhook, withRateLimitRetry };
1488
+ export { ALL_EVENT_SUBTYPES, ARCHETYPE_TEMPLATES, EVENT_SUBTYPES, MAX_DROP_WINDOW_DAYS, MIN_INTEGRATOR_PRICE_SATS, MeClientError, PLATFORM_FEE_POLICY, clearBearerToken, computeFees, config, fromTemplate as configFromTemplate, event, family, federations, getArchetypeTemplate, getBearerToken, getOrigin, identity, oc, onTelemetry, parseTrustAttestationCount, payingAt, payment, refreshEnvelopeJwks, scope, session, setBearerToken, setOrigin, subtypesForClass, validateIntegratorConfig, verifyActivityAttestation, webhook, withRateLimitRetry };
1561
1489
  //# sourceMappingURL=index.mjs.map
1562
1490
  //# sourceMappingURL=index.mjs.map