@stacknet/keyutils 0.4.8 → 0.5.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.
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { KeyUtilsConfig, KeyUtilsCallbacks, KeyWidgetTab, PlatformDownload, NodeKeyInfo, MintResult, FilingResult } from '../types/index.cjs';
3
+ import { KeyUtilsConfig, KeyUtilsCallbacks, KeyWidgetTab, PlatformDownload, NodeKeyInfo, MintResult, FilingResult, FilingTrackerState, StackPayoutCapabilities, PayoutMethod } from '../types/index.cjs';
4
4
 
5
5
  interface KeyUtilsContextValue {
6
6
  config: KeyUtilsConfig;
@@ -16,10 +16,14 @@ declare function KeyUtilsProvider({ config, callbacks, children, }: KeyUtilsProv
16
16
 
17
17
  interface BuyKeyWidgetProps extends KeyUtilsConfig, KeyUtilsCallbacks {
18
18
  defaultTab?: KeyWidgetTab;
19
+ /** When provided, the filing flow surfaces an "Open filing" button that fires this. */
20
+ onViewFiling?: (filingId: string) => void;
21
+ /** When provided, the filing flow surfaces a "Set up earnings account" CTA. */
22
+ onConfigureEarnings?: () => void;
19
23
  className?: string;
20
24
  style?: React.CSSProperties;
21
25
  }
22
- declare function BuyKeyWidget({ apiBaseUrl, stackId, stackName, paymentMethods, merchantWallet, stripePublicKey, theme, maxQuantity, keyImage, keyImageClass, aispImage, termsUrl, onMintSuccess, onMintError, onPaymentStart, onPaymentComplete, onListingCreated, onTransferComplete, defaultTab, className, style, }: BuyKeyWidgetProps): react_jsx_runtime.JSX.Element;
26
+ declare function BuyKeyWidget({ apiBaseUrl, stackId, stackName, paymentMethods, merchantWallet, stripePublicKey, theme, maxQuantity, keyImage, keyImageClass, aispImage, termsUrl, onMintSuccess, onMintError, onPaymentStart, onPaymentComplete, onListingCreated, onTransferComplete, onFilingComplete, onFilingError, defaultTab, onViewFiling, onConfigureEarnings, className, style, }: BuyKeyWidgetProps): react_jsx_runtime.JSX.Element;
23
27
 
24
28
  interface BuyPanelProps {
25
29
  className?: string;
@@ -41,19 +45,42 @@ interface SellPanelProps {
41
45
  declare function SellPanel({ className, style }: SellPanelProps): react_jsx_runtime.JSX.Element;
42
46
 
43
47
  interface KeysPanelProps {
48
+ /**
49
+ * When provided, the filing success state in KeyDetailView shows an
50
+ * "Open filing" button that fires this callback so the host can navigate
51
+ * to /files/{filingId}.
52
+ */
53
+ onViewFiling?: (filingId: string) => void;
54
+ /**
55
+ * When provided, the filing flow surfaces a "Set up earnings account"
56
+ * affordance if the user hasn't connected a payout method yet — the host
57
+ * should route to Settings → Account.
58
+ */
59
+ onConfigureEarnings?: () => void;
44
60
  className?: string;
45
61
  style?: React.CSSProperties;
46
62
  }
47
- declare function KeysPanel({ className, style }: KeysPanelProps): react_jsx_runtime.JSX.Element;
63
+ declare function KeysPanel({ onViewFiling, onConfigureEarnings, className, style }: KeysPanelProps): react_jsx_runtime.JSX.Element;
48
64
 
49
65
  interface KeyDetailViewProps {
50
66
  nodeKey: NodeKeyInfo;
51
67
  onBack: () => void;
52
68
  onKeysChanged?: () => void;
69
+ /**
70
+ * When provided, the filing success state shows an "Open filing" button
71
+ * that fires this callback so the host can navigate to /files/{filingId}.
72
+ */
73
+ onViewFiling?: (filingId: string) => void;
74
+ /**
75
+ * When provided, the filing flow surfaces a "Set up earnings account"
76
+ * button if the user hasn't connected a payout method yet. The host
77
+ * should navigate to Settings → Account.
78
+ */
79
+ onConfigureEarnings?: () => void;
53
80
  className?: string;
54
81
  style?: React.CSSProperties;
55
82
  }
56
- declare function KeyDetailView({ nodeKey, onBack, onKeysChanged, className, style }: KeyDetailViewProps): react_jsx_runtime.JSX.Element;
83
+ declare function KeyDetailView({ nodeKey, onBack, onKeysChanged, onViewFiling, onConfigureEarnings, className, style }: KeyDetailViewProps): react_jsx_runtime.JSX.Element;
57
84
 
58
85
  interface BottomSheetProps {
59
86
  open: boolean;
@@ -115,22 +142,26 @@ declare function TransferPanel({ className, style }: TransferPanelProps): react_
115
142
  interface FilePaperworkViewProps {
116
143
  /** The key id to file paperwork against. */
117
144
  keyId: string;
118
- /**
119
- * Beneficiary payment address (e.g. user's stack-scoped payment_address).
120
- * If omitted, the view shows a "configure your payment address" notice and
121
- * disables the file action.
122
- */
123
- paymentAddress?: string | null;
124
- /** Called after a successful filing. */
145
+ /** Called after a successful filing (after the inline tracker renders). */
125
146
  onComplete?: (result: FilingResult) => void;
126
- /** Called when the user clicks the "configure payment address" affordance. */
127
- onConfigurePayment?: () => void;
128
147
  /** Called when the user clicks the back affordance from the success state. */
129
148
  onBack?: () => void;
149
+ /**
150
+ * Called when the user wants to view the standalone /files/{filingId} page.
151
+ * When provided, the success state shows a "View filing" link that fires
152
+ * this callback (e.g. host can `router.push` to that route).
153
+ */
154
+ onViewFiling?: (filingId: string) => void;
155
+ /**
156
+ * Called when the user clicks the "set up earnings account" CTA shown
157
+ * when no payout method is configured. The host should navigate to
158
+ * Settings → Account so the user can connect a destination.
159
+ */
160
+ onConfigureEarnings?: () => void;
130
161
  className?: string;
131
162
  style?: React.CSSProperties;
132
163
  }
133
- declare function FilePaperworkView({ keyId, paymentAddress, onComplete, onConfigurePayment, onBack, className, style, }: FilePaperworkViewProps): react_jsx_runtime.JSX.Element;
164
+ declare function FilePaperworkView({ keyId, onComplete, onBack, onViewFiling, onConfigureEarnings, className, style, }: FilePaperworkViewProps): react_jsx_runtime.JSX.Element;
134
165
 
135
166
  interface FilePaperworkListProps {
136
167
  /** Called when the user picks an eligible key to file. */
@@ -140,6 +171,54 @@ interface FilePaperworkListProps {
140
171
  }
141
172
  declare function FilePaperworkList({ onSelect, className, style }: FilePaperworkListProps): react_jsx_runtime.JSX.Element;
142
173
 
174
+ interface FilingDetailViewProps {
175
+ filingId: string;
176
+ className?: string;
177
+ style?: React.CSSProperties;
178
+ }
179
+ declare function FilingDetailView({ filingId, className, style }: FilingDetailViewProps): react_jsx_runtime.JSX.Element;
180
+
181
+ interface FilingTrackerProps {
182
+ states: FilingTrackerState[];
183
+ className?: string;
184
+ }
185
+ declare function FilingTracker({ states, className }: FilingTrackerProps): react_jsx_runtime.JSX.Element;
186
+
187
+ interface PayoutMethodPickerProps {
188
+ caps: StackPayoutCapabilities;
189
+ value: PayoutMethod;
190
+ onChange: (method: PayoutMethod) => void;
191
+ className?: string;
192
+ disabled?: boolean;
193
+ }
194
+ declare function PayoutMethodPicker({ caps, value, onChange, className, disabled, }: PayoutMethodPickerProps): react_jsx_runtime.JSX.Element;
195
+
196
+ interface TypingTextProps {
197
+ text: string;
198
+ /** ms per character; default 40. */
199
+ speedMs?: number;
200
+ /** when false, snap to full text, no cursor. */
201
+ playing: boolean;
202
+ className?: string;
203
+ }
204
+ /**
205
+ * Terminal-typing animation: prints characters one at a time with a blinking
206
+ * cursor trailing. When `playing` is false the cursor is hidden and we snap
207
+ * to the full text — used for `done` headlines.
208
+ *
209
+ * Lifted from stripe-resolution; intentionally simple (one setTimeout per
210
+ * char, no RAF).
211
+ */
212
+ declare function TypingText({ text, speedMs, playing, className }: TypingTextProps): react_jsx_runtime.JSX.Element;
213
+
214
+ interface PayoutAccountPanelProps {
215
+ /** Called after a successful connect/disconnect so the host can refresh derived UI. */
216
+ onChange?: () => void;
217
+ className?: string;
218
+ style?: React.CSSProperties;
219
+ }
220
+ declare function PayoutAccountPanel({ onChange, className, style }: PayoutAccountPanelProps): react_jsx_runtime.JSX.Element;
221
+
143
222
  declare const ASCII_KEY_ART: string[];
144
223
  interface DefaultKeyArtProps {
145
224
  className?: string;
@@ -151,4 +230,4 @@ interface DefaultKeyArtProps {
151
230
  }
152
231
  declare function DefaultKeyArt({ className, style, color, ariaLabel, keyImage, keyImageClass, }: DefaultKeyArtProps): react_jsx_runtime.JSX.Element;
153
232
 
154
- export { ASCII_KEY_ART, BottomSheet, type BottomSheetProps, BuyKeyWidget, type BuyKeyWidgetProps, BuyPanel, type BuyPanelProps, DefaultKeyArt, type DefaultKeyArtProps, FilePaperworkList, type FilePaperworkListProps, FilePaperworkView, type FilePaperworkViewProps, KeyBalanceBar, type KeyBalanceBarProps, KeyCard, type KeyCardProps, KeyDetailView, type KeyDetailViewProps, KeyList, type KeyListProps, KeyUtilsProvider, type KeyUtilsProviderProps, KeysPanel, type KeysPanelProps, MintSuccess, type MintSuccessProps, SellPanel, type SellPanelProps, SolanaPayButton, type SolanaPayButtonProps, TransferPanel, type TransferPanelProps, UsePanel, type UsePanelProps, useKeyUtilsContext };
233
+ export { ASCII_KEY_ART, BottomSheet, type BottomSheetProps, BuyKeyWidget, type BuyKeyWidgetProps, BuyPanel, type BuyPanelProps, DefaultKeyArt, type DefaultKeyArtProps, FilePaperworkList, type FilePaperworkListProps, FilePaperworkView, type FilePaperworkViewProps, FilingDetailView, type FilingDetailViewProps, FilingTracker, type FilingTrackerProps, KeyBalanceBar, type KeyBalanceBarProps, KeyCard, type KeyCardProps, KeyDetailView, type KeyDetailViewProps, KeyList, type KeyListProps, KeyUtilsProvider, type KeyUtilsProviderProps, KeysPanel, type KeysPanelProps, MintSuccess, type MintSuccessProps, PayoutAccountPanel, type PayoutAccountPanelProps, PayoutMethodPicker, type PayoutMethodPickerProps, SellPanel, type SellPanelProps, SolanaPayButton, type SolanaPayButtonProps, TransferPanel, type TransferPanelProps, TypingText, UsePanel, type UsePanelProps, useKeyUtilsContext };
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
- import { KeyUtilsConfig, KeyUtilsCallbacks, KeyWidgetTab, PlatformDownload, NodeKeyInfo, MintResult, FilingResult } from '../types/index.js';
3
+ import { KeyUtilsConfig, KeyUtilsCallbacks, KeyWidgetTab, PlatformDownload, NodeKeyInfo, MintResult, FilingResult, FilingTrackerState, StackPayoutCapabilities, PayoutMethod } from '../types/index.js';
4
4
 
5
5
  interface KeyUtilsContextValue {
6
6
  config: KeyUtilsConfig;
@@ -16,10 +16,14 @@ declare function KeyUtilsProvider({ config, callbacks, children, }: KeyUtilsProv
16
16
 
17
17
  interface BuyKeyWidgetProps extends KeyUtilsConfig, KeyUtilsCallbacks {
18
18
  defaultTab?: KeyWidgetTab;
19
+ /** When provided, the filing flow surfaces an "Open filing" button that fires this. */
20
+ onViewFiling?: (filingId: string) => void;
21
+ /** When provided, the filing flow surfaces a "Set up earnings account" CTA. */
22
+ onConfigureEarnings?: () => void;
19
23
  className?: string;
20
24
  style?: React.CSSProperties;
21
25
  }
22
- declare function BuyKeyWidget({ apiBaseUrl, stackId, stackName, paymentMethods, merchantWallet, stripePublicKey, theme, maxQuantity, keyImage, keyImageClass, aispImage, termsUrl, onMintSuccess, onMintError, onPaymentStart, onPaymentComplete, onListingCreated, onTransferComplete, defaultTab, className, style, }: BuyKeyWidgetProps): react_jsx_runtime.JSX.Element;
26
+ declare function BuyKeyWidget({ apiBaseUrl, stackId, stackName, paymentMethods, merchantWallet, stripePublicKey, theme, maxQuantity, keyImage, keyImageClass, aispImage, termsUrl, onMintSuccess, onMintError, onPaymentStart, onPaymentComplete, onListingCreated, onTransferComplete, onFilingComplete, onFilingError, defaultTab, onViewFiling, onConfigureEarnings, className, style, }: BuyKeyWidgetProps): react_jsx_runtime.JSX.Element;
23
27
 
24
28
  interface BuyPanelProps {
25
29
  className?: string;
@@ -41,19 +45,42 @@ interface SellPanelProps {
41
45
  declare function SellPanel({ className, style }: SellPanelProps): react_jsx_runtime.JSX.Element;
42
46
 
43
47
  interface KeysPanelProps {
48
+ /**
49
+ * When provided, the filing success state in KeyDetailView shows an
50
+ * "Open filing" button that fires this callback so the host can navigate
51
+ * to /files/{filingId}.
52
+ */
53
+ onViewFiling?: (filingId: string) => void;
54
+ /**
55
+ * When provided, the filing flow surfaces a "Set up earnings account"
56
+ * affordance if the user hasn't connected a payout method yet — the host
57
+ * should route to Settings → Account.
58
+ */
59
+ onConfigureEarnings?: () => void;
44
60
  className?: string;
45
61
  style?: React.CSSProperties;
46
62
  }
47
- declare function KeysPanel({ className, style }: KeysPanelProps): react_jsx_runtime.JSX.Element;
63
+ declare function KeysPanel({ onViewFiling, onConfigureEarnings, className, style }: KeysPanelProps): react_jsx_runtime.JSX.Element;
48
64
 
49
65
  interface KeyDetailViewProps {
50
66
  nodeKey: NodeKeyInfo;
51
67
  onBack: () => void;
52
68
  onKeysChanged?: () => void;
69
+ /**
70
+ * When provided, the filing success state shows an "Open filing" button
71
+ * that fires this callback so the host can navigate to /files/{filingId}.
72
+ */
73
+ onViewFiling?: (filingId: string) => void;
74
+ /**
75
+ * When provided, the filing flow surfaces a "Set up earnings account"
76
+ * button if the user hasn't connected a payout method yet. The host
77
+ * should navigate to Settings → Account.
78
+ */
79
+ onConfigureEarnings?: () => void;
53
80
  className?: string;
54
81
  style?: React.CSSProperties;
55
82
  }
56
- declare function KeyDetailView({ nodeKey, onBack, onKeysChanged, className, style }: KeyDetailViewProps): react_jsx_runtime.JSX.Element;
83
+ declare function KeyDetailView({ nodeKey, onBack, onKeysChanged, onViewFiling, onConfigureEarnings, className, style }: KeyDetailViewProps): react_jsx_runtime.JSX.Element;
57
84
 
58
85
  interface BottomSheetProps {
59
86
  open: boolean;
@@ -115,22 +142,26 @@ declare function TransferPanel({ className, style }: TransferPanelProps): react_
115
142
  interface FilePaperworkViewProps {
116
143
  /** The key id to file paperwork against. */
117
144
  keyId: string;
118
- /**
119
- * Beneficiary payment address (e.g. user's stack-scoped payment_address).
120
- * If omitted, the view shows a "configure your payment address" notice and
121
- * disables the file action.
122
- */
123
- paymentAddress?: string | null;
124
- /** Called after a successful filing. */
145
+ /** Called after a successful filing (after the inline tracker renders). */
125
146
  onComplete?: (result: FilingResult) => void;
126
- /** Called when the user clicks the "configure payment address" affordance. */
127
- onConfigurePayment?: () => void;
128
147
  /** Called when the user clicks the back affordance from the success state. */
129
148
  onBack?: () => void;
149
+ /**
150
+ * Called when the user wants to view the standalone /files/{filingId} page.
151
+ * When provided, the success state shows a "View filing" link that fires
152
+ * this callback (e.g. host can `router.push` to that route).
153
+ */
154
+ onViewFiling?: (filingId: string) => void;
155
+ /**
156
+ * Called when the user clicks the "set up earnings account" CTA shown
157
+ * when no payout method is configured. The host should navigate to
158
+ * Settings → Account so the user can connect a destination.
159
+ */
160
+ onConfigureEarnings?: () => void;
130
161
  className?: string;
131
162
  style?: React.CSSProperties;
132
163
  }
133
- declare function FilePaperworkView({ keyId, paymentAddress, onComplete, onConfigurePayment, onBack, className, style, }: FilePaperworkViewProps): react_jsx_runtime.JSX.Element;
164
+ declare function FilePaperworkView({ keyId, onComplete, onBack, onViewFiling, onConfigureEarnings, className, style, }: FilePaperworkViewProps): react_jsx_runtime.JSX.Element;
134
165
 
135
166
  interface FilePaperworkListProps {
136
167
  /** Called when the user picks an eligible key to file. */
@@ -140,6 +171,54 @@ interface FilePaperworkListProps {
140
171
  }
141
172
  declare function FilePaperworkList({ onSelect, className, style }: FilePaperworkListProps): react_jsx_runtime.JSX.Element;
142
173
 
174
+ interface FilingDetailViewProps {
175
+ filingId: string;
176
+ className?: string;
177
+ style?: React.CSSProperties;
178
+ }
179
+ declare function FilingDetailView({ filingId, className, style }: FilingDetailViewProps): react_jsx_runtime.JSX.Element;
180
+
181
+ interface FilingTrackerProps {
182
+ states: FilingTrackerState[];
183
+ className?: string;
184
+ }
185
+ declare function FilingTracker({ states, className }: FilingTrackerProps): react_jsx_runtime.JSX.Element;
186
+
187
+ interface PayoutMethodPickerProps {
188
+ caps: StackPayoutCapabilities;
189
+ value: PayoutMethod;
190
+ onChange: (method: PayoutMethod) => void;
191
+ className?: string;
192
+ disabled?: boolean;
193
+ }
194
+ declare function PayoutMethodPicker({ caps, value, onChange, className, disabled, }: PayoutMethodPickerProps): react_jsx_runtime.JSX.Element;
195
+
196
+ interface TypingTextProps {
197
+ text: string;
198
+ /** ms per character; default 40. */
199
+ speedMs?: number;
200
+ /** when false, snap to full text, no cursor. */
201
+ playing: boolean;
202
+ className?: string;
203
+ }
204
+ /**
205
+ * Terminal-typing animation: prints characters one at a time with a blinking
206
+ * cursor trailing. When `playing` is false the cursor is hidden and we snap
207
+ * to the full text — used for `done` headlines.
208
+ *
209
+ * Lifted from stripe-resolution; intentionally simple (one setTimeout per
210
+ * char, no RAF).
211
+ */
212
+ declare function TypingText({ text, speedMs, playing, className }: TypingTextProps): react_jsx_runtime.JSX.Element;
213
+
214
+ interface PayoutAccountPanelProps {
215
+ /** Called after a successful connect/disconnect so the host can refresh derived UI. */
216
+ onChange?: () => void;
217
+ className?: string;
218
+ style?: React.CSSProperties;
219
+ }
220
+ declare function PayoutAccountPanel({ onChange, className, style }: PayoutAccountPanelProps): react_jsx_runtime.JSX.Element;
221
+
143
222
  declare const ASCII_KEY_ART: string[];
144
223
  interface DefaultKeyArtProps {
145
224
  className?: string;
@@ -151,4 +230,4 @@ interface DefaultKeyArtProps {
151
230
  }
152
231
  declare function DefaultKeyArt({ className, style, color, ariaLabel, keyImage, keyImageClass, }: DefaultKeyArtProps): react_jsx_runtime.JSX.Element;
153
232
 
154
- export { ASCII_KEY_ART, BottomSheet, type BottomSheetProps, BuyKeyWidget, type BuyKeyWidgetProps, BuyPanel, type BuyPanelProps, DefaultKeyArt, type DefaultKeyArtProps, FilePaperworkList, type FilePaperworkListProps, FilePaperworkView, type FilePaperworkViewProps, KeyBalanceBar, type KeyBalanceBarProps, KeyCard, type KeyCardProps, KeyDetailView, type KeyDetailViewProps, KeyList, type KeyListProps, KeyUtilsProvider, type KeyUtilsProviderProps, KeysPanel, type KeysPanelProps, MintSuccess, type MintSuccessProps, SellPanel, type SellPanelProps, SolanaPayButton, type SolanaPayButtonProps, TransferPanel, type TransferPanelProps, UsePanel, type UsePanelProps, useKeyUtilsContext };
233
+ export { ASCII_KEY_ART, BottomSheet, type BottomSheetProps, BuyKeyWidget, type BuyKeyWidgetProps, BuyPanel, type BuyPanelProps, DefaultKeyArt, type DefaultKeyArtProps, FilePaperworkList, type FilePaperworkListProps, FilePaperworkView, type FilePaperworkViewProps, FilingDetailView, type FilingDetailViewProps, FilingTracker, type FilingTrackerProps, KeyBalanceBar, type KeyBalanceBarProps, KeyCard, type KeyCardProps, KeyDetailView, type KeyDetailViewProps, KeyList, type KeyListProps, KeyUtilsProvider, type KeyUtilsProviderProps, KeysPanel, type KeysPanelProps, MintSuccess, type MintSuccessProps, PayoutAccountPanel, type PayoutAccountPanelProps, PayoutMethodPicker, type PayoutMethodPickerProps, SellPanel, type SellPanelProps, SolanaPayButton, type SolanaPayButtonProps, TransferPanel, type TransferPanelProps, TypingText, UsePanel, type UsePanelProps, useKeyUtilsContext };