@b3dotfun/sdk 0.1.65-alpha.7 → 0.1.65-alpha.8

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,31 @@
1
+ import type { AnySpendAllClasses } from "./types/classes";
2
+ export interface AnySpendWorkflowTriggerProps {
3
+ /** Payment recipient address (hex) */
4
+ recipientAddress: string;
5
+ /** Destination chain ID */
6
+ chainId: number;
7
+ /** Destination token address */
8
+ tokenAddress: string;
9
+ /** Required payment amount in token base units (wei) */
10
+ amount: string;
11
+ /** Workflow ID to trigger */
12
+ workflowId: string;
13
+ /** Organization ID that owns the workflow */
14
+ orgId: string;
15
+ /** Optional callback metadata merged into the order */
16
+ callbackMetadata?: {
17
+ /** Passed as trigger result inputs — accessible via {{root.result.inputs.*}} */
18
+ inputs?: Record<string, unknown>;
19
+ } & Record<string, unknown>;
20
+ /** Callback when payment succeeds */
21
+ onSuccess?: (amount: string) => void;
22
+ /** Callback when modal is closed */
23
+ onClose?: () => void;
24
+ /** Display mode */
25
+ mode?: "modal" | "page";
26
+ /** Custom action label */
27
+ actionLabel?: string;
28
+ /** Custom class names */
29
+ classes?: AnySpendAllClasses;
30
+ }
31
+ export declare function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }: AnySpendWorkflowTriggerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AnySpendWorkflowTrigger = AnySpendWorkflowTrigger;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const AnySpendDeposit_1 = require("./AnySpendDeposit");
7
+ function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }) {
8
+ const metadata = (0, react_1.useMemo)(() => ({
9
+ workflowId,
10
+ orgId,
11
+ ...callbackMetadata,
12
+ }), [workflowId, orgId, callbackMetadata]);
13
+ return ((0, jsx_runtime_1.jsx)(AnySpendDeposit_1.AnySpendDeposit, { recipientAddress: recipientAddress, destinationTokenAddress: tokenAddress, destinationTokenChainId: chainId, destinationTokenAmount: amount, callbackMetadata: metadata, onSuccess: onSuccess, onClose: onClose, mode: mode, actionLabel: actionLabel, classes: classes, allowDirectTransfer: true }));
14
+ }
@@ -8,6 +8,8 @@ export { AnySpendDeposit } from "./AnySpendDeposit";
8
8
  export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
9
9
  export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
10
10
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
11
+ export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
12
+ export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
11
13
  export * from "./AnySpendFingerprintWrapper";
12
14
  export { AnySpendNFT } from "./AnySpendNFT";
13
15
  export { AnyspendSignatureMint } from "./AnyspendSignatureMint";
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.CryptoReceiveSection = exports.CryptoPaySection = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeUpsideExactIn = exports.AnySpendStakeUpside = exports.AnySpendStakeB3ExactIn = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.HYPE_TOKEN_DETAILS = exports.AnySpendDepositHype = exports.AnySpendDeposit = exports.AnySpendCustomExactIn = exports.AnySpendCustom = exports.AnySpendCollectorClubPurchase = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
17
+ exports.WebviewOnrampPayment = exports.WebviewOnrampOrderStatus = exports.TransferCryptoDetails = exports.TokenBalance = exports.StepProgress = exports.RecipientSelection = exports.OrderTokenAmount = exports.OrderToken = exports.OrderStatus = exports.OrderHistoryItem = exports.OrderHistory = exports.OrderDetailsCollapsible = exports.OrderDetails = exports.CryptoReceiveSection = exports.CryptoPaySection = exports.ChainTokenIcon = exports.AnySpendNFTButton = exports.AnySpendTournament = exports.AnySpendStakeUpsideExactIn = exports.AnySpendStakeUpside = exports.AnySpendStakeB3ExactIn = exports.AnySpendStakeB3 = exports.AnyspendSignatureMint = exports.AnySpendNFT = exports.AnySpendWorkflowTrigger = exports.HYPE_TOKEN_DETAILS = exports.AnySpendDepositHype = exports.AnySpendDeposit = exports.AnySpendCustomExactIn = exports.AnySpendCustom = exports.AnySpendCollectorClubPurchase = exports.AnySpendBuySpin = exports.AnySpendBondKit = exports.AnySpend = void 0;
18
18
  // Components
19
19
  var AnySpend_1 = require("./AnySpend");
20
20
  Object.defineProperty(exports, "AnySpend", { enumerable: true, get: function () { return AnySpend_1.AnySpend; } });
@@ -33,6 +33,8 @@ Object.defineProperty(exports, "AnySpendDeposit", { enumerable: true, get: funct
33
33
  var AnyspendDepositHype_1 = require("./AnyspendDepositHype");
34
34
  Object.defineProperty(exports, "AnySpendDepositHype", { enumerable: true, get: function () { return AnyspendDepositHype_1.AnySpendDepositHype; } });
35
35
  Object.defineProperty(exports, "HYPE_TOKEN_DETAILS", { enumerable: true, get: function () { return AnyspendDepositHype_1.HYPE_TOKEN_DETAILS; } });
36
+ var AnySpendWorkflowTrigger_1 = require("./AnySpendWorkflowTrigger");
37
+ Object.defineProperty(exports, "AnySpendWorkflowTrigger", { enumerable: true, get: function () { return AnySpendWorkflowTrigger_1.AnySpendWorkflowTrigger; } });
36
38
  __exportStar(require("./AnySpendFingerprintWrapper"), exports);
37
39
  var AnySpendNFT_1 = require("./AnySpendNFT");
38
40
  Object.defineProperty(exports, "AnySpendNFT", { enumerable: true, get: function () { return AnySpendNFT_1.AnySpendNFT; } });
@@ -8,6 +8,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("../../../anyspend/react");
9
9
  const AnySpendDeposit_1 = require("../../../anyspend/react/components/AnySpendDeposit");
10
10
  const AnyspendDepositHype_1 = require("../../../anyspend/react/components/AnyspendDepositHype");
11
+ const AnySpendWorkflowTrigger_1 = require("../../../anyspend/react/components/AnySpendWorkflowTrigger");
11
12
  const AnySpendDepositUpside_1 = require("../../../anyspend/react/components/AnySpendDepositUpside");
12
13
  const AnySpendStakeUpside_1 = require("../../../anyspend/react/components/AnySpendStakeUpside");
13
14
  const AnySpendStakeUpsideExactIn_1 = require("../../../anyspend/react/components/AnySpendStakeUpsideExactIn");
@@ -58,6 +59,7 @@ function B3DynamicModal() {
58
59
  "send",
59
60
  "notifications",
60
61
  "anySpendDeposit",
62
+ "anySpendWorkflowTrigger",
61
63
  ];
62
64
  const freestyleTypes = [
63
65
  "anySpendNft",
@@ -128,6 +130,8 @@ function B3DynamicModal() {
128
130
  return (0, jsx_runtime_1.jsx)(react_1.AnySpendCollectorClubPurchase, { ...contentType, mode: "modal" });
129
131
  case "anySpendDeposit":
130
132
  return (0, jsx_runtime_1.jsx)(AnySpendDeposit_1.AnySpendDeposit, { ...contentType, mode: "modal" });
133
+ case "anySpendWorkflowTrigger":
134
+ return (0, jsx_runtime_1.jsx)(AnySpendWorkflowTrigger_1.AnySpendWorkflowTrigger, { ...contentType, mode: "modal" });
131
135
  case "avatarEditor":
132
136
  return (0, jsx_runtime_1.jsx)(AvatarEditor_1.AvatarEditor, { onSetAvatar: contentType.onSuccess });
133
137
  case "deposit":
@@ -477,6 +477,38 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
477
477
  * Props for the AnySpend Deposit modal
478
478
  * Flexible deposit component with optional chain selection
479
479
  */
480
+ /**
481
+ * Props for the AnySpend Workflow Trigger modal
482
+ * Handles payments that trigger b3os-workflow runs
483
+ */
484
+ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
485
+ /** Modal type identifier */
486
+ type: "anySpendWorkflowTrigger";
487
+ /** Payment recipient address (hex) */
488
+ recipientAddress: string;
489
+ /** Destination chain ID */
490
+ chainId: number;
491
+ /** Destination token address */
492
+ tokenAddress: string;
493
+ /** Required payment amount in token base units (wei) */
494
+ amount: string;
495
+ /** Workflow ID to trigger */
496
+ workflowId: string;
497
+ /** Organization ID that owns the workflow */
498
+ orgId: string;
499
+ /** Optional callback metadata */
500
+ callbackMetadata?: {
501
+ inputs?: Record<string, unknown>;
502
+ } & Record<string, unknown>;
503
+ /** Callback when payment succeeds */
504
+ onSuccess?: (amount: string) => void;
505
+ /** Callback when modal is closed */
506
+ onClose?: () => void;
507
+ /** Custom action label */
508
+ actionLabel?: string;
509
+ /** Custom class names */
510
+ classes?: AnySpendAllClasses;
511
+ }
480
512
  export interface AnySpendDepositModalProps extends BaseModalProps {
481
513
  /** Modal type identifier */
482
514
  type: "anySpendDeposit";
@@ -542,7 +574,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
542
574
  /**
543
575
  * Union type of all possible modal content types
544
576
  */
545
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
577
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps;
546
578
  /**
547
579
  * State interface for the modal store
548
580
  */
@@ -0,0 +1,31 @@
1
+ import type { AnySpendAllClasses } from "./types/classes";
2
+ export interface AnySpendWorkflowTriggerProps {
3
+ /** Payment recipient address (hex) */
4
+ recipientAddress: string;
5
+ /** Destination chain ID */
6
+ chainId: number;
7
+ /** Destination token address */
8
+ tokenAddress: string;
9
+ /** Required payment amount in token base units (wei) */
10
+ amount: string;
11
+ /** Workflow ID to trigger */
12
+ workflowId: string;
13
+ /** Organization ID that owns the workflow */
14
+ orgId: string;
15
+ /** Optional callback metadata merged into the order */
16
+ callbackMetadata?: {
17
+ /** Passed as trigger result inputs — accessible via {{root.result.inputs.*}} */
18
+ inputs?: Record<string, unknown>;
19
+ } & Record<string, unknown>;
20
+ /** Callback when payment succeeds */
21
+ onSuccess?: (amount: string) => void;
22
+ /** Callback when modal is closed */
23
+ onClose?: () => void;
24
+ /** Display mode */
25
+ mode?: "modal" | "page";
26
+ /** Custom action label */
27
+ actionLabel?: string;
28
+ /** Custom class names */
29
+ classes?: AnySpendAllClasses;
30
+ }
31
+ export declare function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }: AnySpendWorkflowTriggerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { AnySpendDeposit } from "./AnySpendDeposit.js";
4
+ export function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }) {
5
+ const metadata = useMemo(() => ({
6
+ workflowId,
7
+ orgId,
8
+ ...callbackMetadata,
9
+ }), [workflowId, orgId, callbackMetadata]);
10
+ return (_jsx(AnySpendDeposit, { recipientAddress: recipientAddress, destinationTokenAddress: tokenAddress, destinationTokenChainId: chainId, destinationTokenAmount: amount, callbackMetadata: metadata, onSuccess: onSuccess, onClose: onClose, mode: mode, actionLabel: actionLabel, classes: classes, allowDirectTransfer: true }));
11
+ }
@@ -8,6 +8,8 @@ export { AnySpendDeposit } from "./AnySpendDeposit";
8
8
  export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
9
9
  export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
10
10
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
11
+ export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
12
+ export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
11
13
  export * from "./AnySpendFingerprintWrapper";
12
14
  export { AnySpendNFT } from "./AnySpendNFT";
13
15
  export { AnyspendSignatureMint } from "./AnyspendSignatureMint";
@@ -7,6 +7,7 @@ export { AnySpendCustom } from "./AnySpendCustom.js";
7
7
  export { AnySpendCustomExactIn } from "./AnySpendCustomExactIn.js";
8
8
  export { AnySpendDeposit } from "./AnySpendDeposit.js";
9
9
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype.js";
10
+ export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger.js";
10
11
  export * from "./AnySpendFingerprintWrapper.js";
11
12
  export { AnySpendNFT } from "./AnySpendNFT.js";
12
13
  export { AnyspendSignatureMint } from "./AnyspendSignatureMint.js";
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AnySpend, AnySpendBondKit, AnySpendBuySpin, AnySpendCollectorClubPurchase, AnySpendNFT, AnyspendSignatureMint, AnySpendStakeB3, AnySpendStakeB3ExactIn, AnySpendTournament, OrderHistory, } from "../../../anyspend/react/index.js";
3
3
  import { AnySpendDeposit } from "../../../anyspend/react/components/AnySpendDeposit.js";
4
4
  import { AnySpendDepositHype } from "../../../anyspend/react/components/AnyspendDepositHype.js";
5
+ import { AnySpendWorkflowTrigger } from "../../../anyspend/react/components/AnySpendWorkflowTrigger.js";
5
6
  import { AnySpendDepositUpside } from "../../../anyspend/react/components/AnySpendDepositUpside.js";
6
7
  import { AnySpendStakeUpside } from "../../../anyspend/react/components/AnySpendStakeUpside.js";
7
8
  import { AnySpendStakeUpsideExactIn } from "../../../anyspend/react/components/AnySpendStakeUpsideExactIn.js";
@@ -52,6 +53,7 @@ export function B3DynamicModal() {
52
53
  "send",
53
54
  "notifications",
54
55
  "anySpendDeposit",
56
+ "anySpendWorkflowTrigger",
55
57
  ];
56
58
  const freestyleTypes = [
57
59
  "anySpendNft",
@@ -122,6 +124,8 @@ export function B3DynamicModal() {
122
124
  return _jsx(AnySpendCollectorClubPurchase, { ...contentType, mode: "modal" });
123
125
  case "anySpendDeposit":
124
126
  return _jsx(AnySpendDeposit, { ...contentType, mode: "modal" });
127
+ case "anySpendWorkflowTrigger":
128
+ return _jsx(AnySpendWorkflowTrigger, { ...contentType, mode: "modal" });
125
129
  case "avatarEditor":
126
130
  return _jsx(AvatarEditor, { onSetAvatar: contentType.onSuccess });
127
131
  case "deposit":
@@ -477,6 +477,38 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
477
477
  * Props for the AnySpend Deposit modal
478
478
  * Flexible deposit component with optional chain selection
479
479
  */
480
+ /**
481
+ * Props for the AnySpend Workflow Trigger modal
482
+ * Handles payments that trigger b3os-workflow runs
483
+ */
484
+ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
485
+ /** Modal type identifier */
486
+ type: "anySpendWorkflowTrigger";
487
+ /** Payment recipient address (hex) */
488
+ recipientAddress: string;
489
+ /** Destination chain ID */
490
+ chainId: number;
491
+ /** Destination token address */
492
+ tokenAddress: string;
493
+ /** Required payment amount in token base units (wei) */
494
+ amount: string;
495
+ /** Workflow ID to trigger */
496
+ workflowId: string;
497
+ /** Organization ID that owns the workflow */
498
+ orgId: string;
499
+ /** Optional callback metadata */
500
+ callbackMetadata?: {
501
+ inputs?: Record<string, unknown>;
502
+ } & Record<string, unknown>;
503
+ /** Callback when payment succeeds */
504
+ onSuccess?: (amount: string) => void;
505
+ /** Callback when modal is closed */
506
+ onClose?: () => void;
507
+ /** Custom action label */
508
+ actionLabel?: string;
509
+ /** Custom class names */
510
+ classes?: AnySpendAllClasses;
511
+ }
480
512
  export interface AnySpendDepositModalProps extends BaseModalProps {
481
513
  /** Modal type identifier */
482
514
  type: "anySpendDeposit";
@@ -542,7 +574,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
542
574
  /**
543
575
  * Union type of all possible modal content types
544
576
  */
545
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
577
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps;
546
578
  /**
547
579
  * State interface for the modal store
548
580
  */
@@ -0,0 +1,31 @@
1
+ import type { AnySpendAllClasses } from "./types/classes";
2
+ export interface AnySpendWorkflowTriggerProps {
3
+ /** Payment recipient address (hex) */
4
+ recipientAddress: string;
5
+ /** Destination chain ID */
6
+ chainId: number;
7
+ /** Destination token address */
8
+ tokenAddress: string;
9
+ /** Required payment amount in token base units (wei) */
10
+ amount: string;
11
+ /** Workflow ID to trigger */
12
+ workflowId: string;
13
+ /** Organization ID that owns the workflow */
14
+ orgId: string;
15
+ /** Optional callback metadata merged into the order */
16
+ callbackMetadata?: {
17
+ /** Passed as trigger result inputs — accessible via {{root.result.inputs.*}} */
18
+ inputs?: Record<string, unknown>;
19
+ } & Record<string, unknown>;
20
+ /** Callback when payment succeeds */
21
+ onSuccess?: (amount: string) => void;
22
+ /** Callback when modal is closed */
23
+ onClose?: () => void;
24
+ /** Display mode */
25
+ mode?: "modal" | "page";
26
+ /** Custom action label */
27
+ actionLabel?: string;
28
+ /** Custom class names */
29
+ classes?: AnySpendAllClasses;
30
+ }
31
+ export declare function AnySpendWorkflowTrigger({ recipientAddress, chainId, tokenAddress, amount, workflowId, orgId, callbackMetadata, onSuccess, onClose, mode, actionLabel, classes, }: AnySpendWorkflowTriggerProps): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,8 @@ export { AnySpendDeposit } from "./AnySpendDeposit";
8
8
  export type { AnySpendDepositProps, ChainConfig, DepositContractConfig } from "./AnySpendDeposit";
9
9
  export type { AnySpendAllClasses, AnySpendClasses, AnySpendCustomExactInClasses, AnySpendDepositClasses, CryptoPaymentMethodClasses, CryptoPaySectionClasses, CryptoReceiveSectionClasses, FiatPaymentMethodClasses, OrderDetailsClasses, PanelOnrampClasses, QRDepositClasses, RecipientSelectionClasses, } from "./types/classes";
10
10
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
11
+ export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
12
+ export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
11
13
  export * from "./AnySpendFingerprintWrapper";
12
14
  export { AnySpendNFT } from "./AnySpendNFT";
13
15
  export { AnyspendSignatureMint } from "./AnyspendSignatureMint";
@@ -477,6 +477,38 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
477
477
  * Props for the AnySpend Deposit modal
478
478
  * Flexible deposit component with optional chain selection
479
479
  */
480
+ /**
481
+ * Props for the AnySpend Workflow Trigger modal
482
+ * Handles payments that trigger b3os-workflow runs
483
+ */
484
+ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
485
+ /** Modal type identifier */
486
+ type: "anySpendWorkflowTrigger";
487
+ /** Payment recipient address (hex) */
488
+ recipientAddress: string;
489
+ /** Destination chain ID */
490
+ chainId: number;
491
+ /** Destination token address */
492
+ tokenAddress: string;
493
+ /** Required payment amount in token base units (wei) */
494
+ amount: string;
495
+ /** Workflow ID to trigger */
496
+ workflowId: string;
497
+ /** Organization ID that owns the workflow */
498
+ orgId: string;
499
+ /** Optional callback metadata */
500
+ callbackMetadata?: {
501
+ inputs?: Record<string, unknown>;
502
+ } & Record<string, unknown>;
503
+ /** Callback when payment succeeds */
504
+ onSuccess?: (amount: string) => void;
505
+ /** Callback when modal is closed */
506
+ onClose?: () => void;
507
+ /** Custom action label */
508
+ actionLabel?: string;
509
+ /** Custom class names */
510
+ classes?: AnySpendAllClasses;
511
+ }
480
512
  export interface AnySpendDepositModalProps extends BaseModalProps {
481
513
  /** Modal type identifier */
482
514
  type: "anySpendDeposit";
@@ -542,7 +574,7 @@ export interface AnySpendDepositModalProps extends BaseModalProps {
542
574
  /**
543
575
  * Union type of all possible modal content types
544
576
  */
545
- export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps;
577
+ export type ModalContentType = SignInWithB3ModalProps | RequestPermissionsModalProps | ManageAccountModalProps | AnySpendModalProps | AnyspendOrderDetailsProps | AnySpendNftProps | AnySpendJoinTournamentProps | AnySpendFundTournamentProps | AnySpendOrderHistoryProps | AnySpendStakeB3Props | AnySpendStakeB3ExactInProps | AnySpendStakeUpsideProps | AnySpendStakeUpsideExactInProps | AnySpendDepositUpsideProps | AnySpendBuySpinProps | AnySpendSignatureMintProps | AnySpendBondKitProps | LinkAccountModalProps | LinkNewAccountModalProps | AnySpendDepositHypeProps | AvatarEditorModalProps | DepositModalProps | SendModalProps | NotificationsModalProps | AnySpendCollectorClubPurchaseProps | AnySpendDepositModalProps | AnySpendWorkflowTriggerModalProps;
546
578
  /**
547
579
  * State interface for the modal store
548
580
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.1.65-alpha.7",
3
+ "version": "0.1.65-alpha.8",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -0,0 +1,73 @@
1
+ import { useMemo } from "react";
2
+ import type { AnySpendAllClasses } from "./types/classes";
3
+ import { AnySpendDeposit } from "./AnySpendDeposit";
4
+
5
+ export interface AnySpendWorkflowTriggerProps {
6
+ /** Payment recipient address (hex) */
7
+ recipientAddress: string;
8
+ /** Destination chain ID */
9
+ chainId: number;
10
+ /** Destination token address */
11
+ tokenAddress: string;
12
+ /** Required payment amount in token base units (wei) */
13
+ amount: string;
14
+ /** Workflow ID to trigger */
15
+ workflowId: string;
16
+ /** Organization ID that owns the workflow */
17
+ orgId: string;
18
+ /** Optional callback metadata merged into the order */
19
+ callbackMetadata?: {
20
+ /** Passed as trigger result inputs — accessible via {{root.result.inputs.*}} */
21
+ inputs?: Record<string, unknown>;
22
+ } & Record<string, unknown>;
23
+ /** Callback when payment succeeds */
24
+ onSuccess?: (amount: string) => void;
25
+ /** Callback when modal is closed */
26
+ onClose?: () => void;
27
+ /** Display mode */
28
+ mode?: "modal" | "page";
29
+ /** Custom action label */
30
+ actionLabel?: string;
31
+ /** Custom class names */
32
+ classes?: AnySpendAllClasses;
33
+ }
34
+
35
+ export function AnySpendWorkflowTrigger({
36
+ recipientAddress,
37
+ chainId,
38
+ tokenAddress,
39
+ amount,
40
+ workflowId,
41
+ orgId,
42
+ callbackMetadata,
43
+ onSuccess,
44
+ onClose,
45
+ mode,
46
+ actionLabel,
47
+ classes,
48
+ }: AnySpendWorkflowTriggerProps) {
49
+ const metadata = useMemo(
50
+ () => ({
51
+ workflowId,
52
+ orgId,
53
+ ...callbackMetadata,
54
+ }),
55
+ [workflowId, orgId, callbackMetadata],
56
+ );
57
+
58
+ return (
59
+ <AnySpendDeposit
60
+ recipientAddress={recipientAddress}
61
+ destinationTokenAddress={tokenAddress}
62
+ destinationTokenChainId={chainId}
63
+ destinationTokenAmount={amount}
64
+ callbackMetadata={metadata}
65
+ onSuccess={onSuccess}
66
+ onClose={onClose}
67
+ mode={mode}
68
+ actionLabel={actionLabel}
69
+ classes={classes}
70
+ allowDirectTransfer
71
+ />
72
+ );
73
+ }
@@ -24,6 +24,8 @@ export type {
24
24
  RecipientSelectionClasses,
25
25
  } from "./types/classes";
26
26
  export { AnySpendDepositHype, HYPE_TOKEN_DETAILS } from "./AnyspendDepositHype";
27
+ export { AnySpendWorkflowTrigger } from "./AnySpendWorkflowTrigger";
28
+ export type { AnySpendWorkflowTriggerProps } from "./AnySpendWorkflowTrigger";
27
29
  export * from "./AnySpendFingerprintWrapper";
28
30
  export { AnySpendNFT } from "./AnySpendNFT";
29
31
  export { AnyspendSignatureMint } from "./AnyspendSignatureMint";
@@ -12,6 +12,7 @@ import {
12
12
  } from "@b3dotfun/sdk/anyspend/react";
13
13
  import { AnySpendDeposit } from "@b3dotfun/sdk/anyspend/react/components/AnySpendDeposit";
14
14
  import { AnySpendDepositHype } from "@b3dotfun/sdk/anyspend/react/components/AnyspendDepositHype";
15
+ import { AnySpendWorkflowTrigger } from "@b3dotfun/sdk/anyspend/react/components/AnySpendWorkflowTrigger";
15
16
  import { AnySpendDepositUpside } from "@b3dotfun/sdk/anyspend/react/components/AnySpendDepositUpside";
16
17
  import { AnySpendStakeUpside } from "@b3dotfun/sdk/anyspend/react/components/AnySpendStakeUpside";
17
18
  import { AnySpendStakeUpsideExactIn } from "@b3dotfun/sdk/anyspend/react/components/AnySpendStakeUpsideExactIn";
@@ -65,6 +66,7 @@ export function B3DynamicModal() {
65
66
  "send",
66
67
  "notifications",
67
68
  "anySpendDeposit",
69
+ "anySpendWorkflowTrigger",
68
70
  ];
69
71
 
70
72
  const freestyleTypes = [
@@ -152,6 +154,8 @@ export function B3DynamicModal() {
152
154
  return <AnySpendCollectorClubPurchase {...contentType} mode="modal" />;
153
155
  case "anySpendDeposit":
154
156
  return <AnySpendDeposit {...contentType} mode="modal" />;
157
+ case "anySpendWorkflowTrigger":
158
+ return <AnySpendWorkflowTrigger {...contentType} mode="modal" />;
155
159
  case "avatarEditor":
156
160
  return <AvatarEditor onSetAvatar={contentType.onSuccess} />;
157
161
  case "deposit":
@@ -505,6 +505,39 @@ export interface AnySpendCollectorClubPurchaseProps extends BaseModalProps {
505
505
  * Props for the AnySpend Deposit modal
506
506
  * Flexible deposit component with optional chain selection
507
507
  */
508
+ /**
509
+ * Props for the AnySpend Workflow Trigger modal
510
+ * Handles payments that trigger b3os-workflow runs
511
+ */
512
+ export interface AnySpendWorkflowTriggerModalProps extends BaseModalProps {
513
+ /** Modal type identifier */
514
+ type: "anySpendWorkflowTrigger";
515
+ /** Payment recipient address (hex) */
516
+ recipientAddress: string;
517
+ /** Destination chain ID */
518
+ chainId: number;
519
+ /** Destination token address */
520
+ tokenAddress: string;
521
+ /** Required payment amount in token base units (wei) */
522
+ amount: string;
523
+ /** Workflow ID to trigger */
524
+ workflowId: string;
525
+ /** Organization ID that owns the workflow */
526
+ orgId: string;
527
+ /** Optional callback metadata */
528
+ callbackMetadata?: {
529
+ inputs?: Record<string, unknown>;
530
+ } & Record<string, unknown>;
531
+ /** Callback when payment succeeds */
532
+ onSuccess?: (amount: string) => void;
533
+ /** Callback when modal is closed */
534
+ onClose?: () => void;
535
+ /** Custom action label */
536
+ actionLabel?: string;
537
+ /** Custom class names */
538
+ classes?: AnySpendAllClasses;
539
+ }
540
+
508
541
  export interface AnySpendDepositModalProps extends BaseModalProps {
509
542
  /** Modal type identifier */
510
543
  type: "anySpendDeposit";
@@ -595,8 +628,8 @@ export type ModalContentType =
595
628
  | SendModalProps
596
629
  | NotificationsModalProps
597
630
  | AnySpendCollectorClubPurchaseProps
598
- | AnySpendDepositModalProps;
599
- // Add other modal types here like: | OtherModalProps | AnotherModalProps
631
+ | AnySpendDepositModalProps
632
+ | AnySpendWorkflowTriggerModalProps;
600
633
 
601
634
  /**
602
635
  * State interface for the modal store