@orangecheck/me-client 0.16.0 → 0.18.0

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.
@@ -0,0 +1,163 @@
1
+ declare const PLATFORM_FEE_POLICY: {
2
+ readonly pct: 0.2;
3
+ readonly min_floor_sats: 1;
4
+ readonly ratified: "2026-04-30";
5
+ };
6
+ declare const MIN_INTEGRATOR_PRICE_SATS = 5;
7
+ type EventClass = 'A' | 'B' | 'C';
8
+ type ClassASubtype = 'account_creation' | 'account_recovery' | 'attest_bond_increased' | 'payment_method_connected' | 'agent_delegation_issued' | 'recovery_method_updated';
9
+ type ClassBSubtype = 'payment_authorization' | 'scoped_action_authorization' | 'attest_verification_at_gate' | 'stamp_signing' | 'pledge_resolution';
10
+ type ClassCSubtype = 'session_creation';
11
+ type EventSubtype = ClassASubtype | ClassBSubtype | ClassCSubtype;
12
+ type AttestTier = 'anonymous' | 'bonded';
13
+ type SiteFeeShape = {
14
+ kind: 'fixed_sats';
15
+ sats: number;
16
+ } | {
17
+ kind: 'percent_of_amount';
18
+ pct: number;
19
+ };
20
+ interface IntegratorEventConfig {
21
+ enabled: boolean;
22
+ site_pays: SiteFeeShape;
23
+ user_share_pct: number;
24
+ }
25
+ interface IntegratorPriceConfig {
26
+ project_key: string;
27
+ display_name: string;
28
+ domain: string;
29
+ updated_at: string;
30
+ events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
31
+ }
32
+ interface ComputedFees {
33
+ gross_fee_sats: number;
34
+ platform_fee_sats: number;
35
+ user_earned_sats: number;
36
+ site_rebate_sats: number;
37
+ }
38
+ declare function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
39
+ interface ValidationResult {
40
+ ok: boolean;
41
+ errors: {
42
+ subtype?: EventSubtype;
43
+ message: string;
44
+ }[];
45
+ }
46
+ declare function validateIntegratorConfig(cfg: IntegratorPriceConfig): ValidationResult;
47
+ interface BillableEvent {
48
+ id: string;
49
+ occurred_at: string;
50
+ class: EventClass;
51
+ subtype: EventSubtype;
52
+ site: {
53
+ domain: string;
54
+ display_name: string;
55
+ };
56
+ gross_fee_sats: number;
57
+ platform_fee_sats: number;
58
+ user_earned_sats: number;
59
+ site_rebate_sats: number;
60
+ verify_url: string;
61
+ is_agent?: boolean;
62
+ }
63
+ interface WebhookPayload extends BillableEvent {
64
+ kind: 'oc-billable-event';
65
+ sub: string;
66
+ scopes?: Partial<Record<'bitcoin_address' | 'email' | 'attest_tier' | 'display_name' | 'cross_integrator_event_count' | 'cross_integrator_human_event_count' | 'trust_attestation_count' | 'trust_attestations_bundle', string>>;
67
+ }
68
+ interface WebhookHeaders {
69
+ 'OC-Signature': string;
70
+ 'OC-Key-Id': string;
71
+ 'OC-Envelope-Id': string;
72
+ 'OC-Subtype': EventSubtype;
73
+ 'OC-Class': EventClass;
74
+ 'OC-Delivery-Attempt': string;
75
+ }
76
+ interface SessionPolicy {
77
+ duration_seconds: number;
78
+ refresh: 'sliding' | 'rolling' | 'none';
79
+ sensitive_actions?: 're-auth' | 'none';
80
+ }
81
+ interface Session {
82
+ id: string;
83
+ identity: string;
84
+ opens_at: string;
85
+ expires_at: string;
86
+ policy: SessionPolicy;
87
+ scope: string[];
88
+ }
89
+ interface SignInOptions {
90
+ scope: string[];
91
+ sessionPolicy?: Partial<SessionPolicy>;
92
+ returnTo?: string;
93
+ }
94
+ interface PaymentAuthorizeOptions {
95
+ identity: string;
96
+ amount_sats?: number;
97
+ usd_cents?: number;
98
+ description: string;
99
+ external_ref?: string;
100
+ }
101
+ interface PaymentResult {
102
+ id: string;
103
+ status: 'authorized' | 'failed' | 'cancelled';
104
+ sats_charged?: number;
105
+ user_envelope_id?: string;
106
+ verify_url?: string;
107
+ }
108
+ interface TelemetryEvent {
109
+ code: 'session.intra_signin' | 'session.token_refresh' | 'session.navigation' | 'auth.signin_failed' | 'auth.signin_cancelled' | 'auth.signin_rejected' | 'verify.passive_check';
110
+ timestamp: string;
111
+ session_id?: string;
112
+ }
113
+ type FederationStatus = 'recruiting' | 'forming' | 'binding' | 'live';
114
+ interface Federation {
115
+ slug: string;
116
+ name: string;
117
+ status: FederationStatus;
118
+ threshold: string;
119
+ target_guardian_count: number;
120
+ invite: string | null;
121
+ charter_hash: string | null;
122
+ last_attestation_at: string | null;
123
+ geography_hint: string;
124
+ geography_requirements?: string;
125
+ charter_status?: string;
126
+ ceremony_window?: string;
127
+ why_this_one?: string;
128
+ apply_cta?: string;
129
+ apply_href?: string;
130
+ }
131
+ type SigningMethod = 'fedimint_threshold' | 'fedimint_client' | 'bip322';
132
+
133
+ type IntegratorArchetype = 'saas-paywall' | 'marketplace' | 'content-platform' | 'gaming' | 'agent-only';
134
+ interface ProjectIdentity {
135
+ project_key: string;
136
+ domain: string;
137
+ display_name: string;
138
+ }
139
+ interface ArchetypeTemplate {
140
+ id: IntegratorArchetype;
141
+ label: string;
142
+ summary: string;
143
+ examples: readonly string[];
144
+ events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
145
+ }
146
+ declare const ARCHETYPE_TEMPLATES: readonly ArchetypeTemplate[];
147
+ declare function fromTemplate(useCase: IntegratorArchetype, identity: ProjectIdentity): IntegratorPriceConfig;
148
+ declare function getArchetypeTemplate(id: IntegratorArchetype): ArchetypeTemplate;
149
+
150
+ interface EventSubtypeMetadata {
151
+ id: EventSubtype;
152
+ class: EventClass;
153
+ label: string;
154
+ fires_when: string;
155
+ example: string;
156
+ common_use_cases: readonly string[];
157
+ typical_price_hint: string;
158
+ }
159
+ declare const EVENT_SUBTYPES: Record<EventSubtype, EventSubtypeMetadata>;
160
+ declare function subtypesForClass(cls: EventClass): EventSubtypeMetadata[];
161
+ declare const ALL_EVENT_SUBTYPES: readonly EventSubtypeMetadata[];
162
+
163
+ export { type ArchetypeTemplate as A, type BillableEvent as B, type ClassASubtype as C, type EventSubtype as E, type Federation as F, type IntegratorPriceConfig as I, MIN_INTEGRATOR_PRICE_SATS as M, type PaymentAuthorizeOptions as P, type SessionPolicy as S, type TelemetryEvent as T, type ValidationResult as V, type WebhookHeaders as W, type Session as a, type SignInOptions as b, type PaymentResult as c, ALL_EVENT_SUBTYPES as d, ARCHETYPE_TEMPLATES as e, fromTemplate as f, getArchetypeTemplate as g, type AttestTier as h, type ClassBSubtype as i, type ClassCSubtype as j, type ComputedFees as k, EVENT_SUBTYPES as l, type EventClass as m, type EventSubtypeMetadata as n, type FederationStatus as o, type IntegratorArchetype as p, type IntegratorEventConfig as q, PLATFORM_FEE_POLICY as r, type SigningMethod as s, type SiteFeeShape as t, type WebhookPayload as u, computeFees as v, subtypesForClass as w, validateIntegratorConfig as x };
@@ -0,0 +1,163 @@
1
+ declare const PLATFORM_FEE_POLICY: {
2
+ readonly pct: 0.2;
3
+ readonly min_floor_sats: 1;
4
+ readonly ratified: "2026-04-30";
5
+ };
6
+ declare const MIN_INTEGRATOR_PRICE_SATS = 5;
7
+ type EventClass = 'A' | 'B' | 'C';
8
+ type ClassASubtype = 'account_creation' | 'account_recovery' | 'attest_bond_increased' | 'payment_method_connected' | 'agent_delegation_issued' | 'recovery_method_updated';
9
+ type ClassBSubtype = 'payment_authorization' | 'scoped_action_authorization' | 'attest_verification_at_gate' | 'stamp_signing' | 'pledge_resolution';
10
+ type ClassCSubtype = 'session_creation';
11
+ type EventSubtype = ClassASubtype | ClassBSubtype | ClassCSubtype;
12
+ type AttestTier = 'anonymous' | 'bonded';
13
+ type SiteFeeShape = {
14
+ kind: 'fixed_sats';
15
+ sats: number;
16
+ } | {
17
+ kind: 'percent_of_amount';
18
+ pct: number;
19
+ };
20
+ interface IntegratorEventConfig {
21
+ enabled: boolean;
22
+ site_pays: SiteFeeShape;
23
+ user_share_pct: number;
24
+ }
25
+ interface IntegratorPriceConfig {
26
+ project_key: string;
27
+ display_name: string;
28
+ domain: string;
29
+ updated_at: string;
30
+ events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
31
+ }
32
+ interface ComputedFees {
33
+ gross_fee_sats: number;
34
+ platform_fee_sats: number;
35
+ user_earned_sats: number;
36
+ site_rebate_sats: number;
37
+ }
38
+ declare function computeFees(cfg: IntegratorEventConfig, payment_amount_sats?: number): ComputedFees;
39
+ interface ValidationResult {
40
+ ok: boolean;
41
+ errors: {
42
+ subtype?: EventSubtype;
43
+ message: string;
44
+ }[];
45
+ }
46
+ declare function validateIntegratorConfig(cfg: IntegratorPriceConfig): ValidationResult;
47
+ interface BillableEvent {
48
+ id: string;
49
+ occurred_at: string;
50
+ class: EventClass;
51
+ subtype: EventSubtype;
52
+ site: {
53
+ domain: string;
54
+ display_name: string;
55
+ };
56
+ gross_fee_sats: number;
57
+ platform_fee_sats: number;
58
+ user_earned_sats: number;
59
+ site_rebate_sats: number;
60
+ verify_url: string;
61
+ is_agent?: boolean;
62
+ }
63
+ interface WebhookPayload extends BillableEvent {
64
+ kind: 'oc-billable-event';
65
+ sub: string;
66
+ scopes?: Partial<Record<'bitcoin_address' | 'email' | 'attest_tier' | 'display_name' | 'cross_integrator_event_count' | 'cross_integrator_human_event_count' | 'trust_attestation_count' | 'trust_attestations_bundle', string>>;
67
+ }
68
+ interface WebhookHeaders {
69
+ 'OC-Signature': string;
70
+ 'OC-Key-Id': string;
71
+ 'OC-Envelope-Id': string;
72
+ 'OC-Subtype': EventSubtype;
73
+ 'OC-Class': EventClass;
74
+ 'OC-Delivery-Attempt': string;
75
+ }
76
+ interface SessionPolicy {
77
+ duration_seconds: number;
78
+ refresh: 'sliding' | 'rolling' | 'none';
79
+ sensitive_actions?: 're-auth' | 'none';
80
+ }
81
+ interface Session {
82
+ id: string;
83
+ identity: string;
84
+ opens_at: string;
85
+ expires_at: string;
86
+ policy: SessionPolicy;
87
+ scope: string[];
88
+ }
89
+ interface SignInOptions {
90
+ scope: string[];
91
+ sessionPolicy?: Partial<SessionPolicy>;
92
+ returnTo?: string;
93
+ }
94
+ interface PaymentAuthorizeOptions {
95
+ identity: string;
96
+ amount_sats?: number;
97
+ usd_cents?: number;
98
+ description: string;
99
+ external_ref?: string;
100
+ }
101
+ interface PaymentResult {
102
+ id: string;
103
+ status: 'authorized' | 'failed' | 'cancelled';
104
+ sats_charged?: number;
105
+ user_envelope_id?: string;
106
+ verify_url?: string;
107
+ }
108
+ interface TelemetryEvent {
109
+ code: 'session.intra_signin' | 'session.token_refresh' | 'session.navigation' | 'auth.signin_failed' | 'auth.signin_cancelled' | 'auth.signin_rejected' | 'verify.passive_check';
110
+ timestamp: string;
111
+ session_id?: string;
112
+ }
113
+ type FederationStatus = 'recruiting' | 'forming' | 'binding' | 'live';
114
+ interface Federation {
115
+ slug: string;
116
+ name: string;
117
+ status: FederationStatus;
118
+ threshold: string;
119
+ target_guardian_count: number;
120
+ invite: string | null;
121
+ charter_hash: string | null;
122
+ last_attestation_at: string | null;
123
+ geography_hint: string;
124
+ geography_requirements?: string;
125
+ charter_status?: string;
126
+ ceremony_window?: string;
127
+ why_this_one?: string;
128
+ apply_cta?: string;
129
+ apply_href?: string;
130
+ }
131
+ type SigningMethod = 'fedimint_threshold' | 'fedimint_client' | 'bip322';
132
+
133
+ type IntegratorArchetype = 'saas-paywall' | 'marketplace' | 'content-platform' | 'gaming' | 'agent-only';
134
+ interface ProjectIdentity {
135
+ project_key: string;
136
+ domain: string;
137
+ display_name: string;
138
+ }
139
+ interface ArchetypeTemplate {
140
+ id: IntegratorArchetype;
141
+ label: string;
142
+ summary: string;
143
+ examples: readonly string[];
144
+ events: Partial<Record<EventSubtype, IntegratorEventConfig>>;
145
+ }
146
+ declare const ARCHETYPE_TEMPLATES: readonly ArchetypeTemplate[];
147
+ declare function fromTemplate(useCase: IntegratorArchetype, identity: ProjectIdentity): IntegratorPriceConfig;
148
+ declare function getArchetypeTemplate(id: IntegratorArchetype): ArchetypeTemplate;
149
+
150
+ interface EventSubtypeMetadata {
151
+ id: EventSubtype;
152
+ class: EventClass;
153
+ label: string;
154
+ fires_when: string;
155
+ example: string;
156
+ common_use_cases: readonly string[];
157
+ typical_price_hint: string;
158
+ }
159
+ declare const EVENT_SUBTYPES: Record<EventSubtype, EventSubtypeMetadata>;
160
+ declare function subtypesForClass(cls: EventClass): EventSubtypeMetadata[];
161
+ declare const ALL_EVENT_SUBTYPES: readonly EventSubtypeMetadata[];
162
+
163
+ export { type ArchetypeTemplate as A, type BillableEvent as B, type ClassASubtype as C, type EventSubtype as E, type Federation as F, type IntegratorPriceConfig as I, MIN_INTEGRATOR_PRICE_SATS as M, type PaymentAuthorizeOptions as P, type SessionPolicy as S, type TelemetryEvent as T, type ValidationResult as V, type WebhookHeaders as W, type Session as a, type SignInOptions as b, type PaymentResult as c, ALL_EVENT_SUBTYPES as d, ARCHETYPE_TEMPLATES as e, fromTemplate as f, getArchetypeTemplate as g, type AttestTier as h, type ClassBSubtype as i, type ClassCSubtype as j, type ComputedFees as k, EVENT_SUBTYPES as l, type EventClass as m, type EventSubtypeMetadata as n, type FederationStatus as o, type IntegratorArchetype as p, type IntegratorEventConfig as q, PLATFORM_FEE_POLICY as r, type SigningMethod as s, type SiteFeeShape as t, type WebhookPayload as u, computeFees as v, subtypesForClass as w, validateIntegratorConfig as x };
@@ -0,0 +1 @@
1
+ export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, A as ArchetypeTemplate, h as AttestTier, B as BillableEvent, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, l as EVENT_SUBTYPES, m as EventClass, E as EventSubtype, n as EventSubtypeMetadata, p as IntegratorArchetype, q as IntegratorEventConfig, I as IntegratorPriceConfig, M as MIN_INTEGRATOR_PRICE_SATS, r as PLATFORM_FEE_POLICY, t as SiteFeeShape, V as ValidationResult, W as WebhookHeaders, u as WebhookPayload, v as computeFees, f as configFromTemplate, g as getArchetypeTemplate, w as subtypesForClass, x as validateIntegratorConfig } from './integrator-m712Srxt.mjs';
@@ -0,0 +1 @@
1
+ export { d as ALL_EVENT_SUBTYPES, e as ARCHETYPE_TEMPLATES, A as ArchetypeTemplate, h as AttestTier, B as BillableEvent, C as ClassASubtype, i as ClassBSubtype, j as ClassCSubtype, k as ComputedFees, l as EVENT_SUBTYPES, m as EventClass, E as EventSubtype, n as EventSubtypeMetadata, p as IntegratorArchetype, q as IntegratorEventConfig, I as IntegratorPriceConfig, M as MIN_INTEGRATOR_PRICE_SATS, r as PLATFORM_FEE_POLICY, t as SiteFeeShape, V as ValidationResult, W as WebhookHeaders, u as WebhookPayload, v as computeFees, f as configFromTemplate, g as getArchetypeTemplate, w as subtypesForClass, x as validateIntegratorConfig } from './integrator-m712Srxt.js';