@spicenet-io/spiceflow-ui 3.3.85-next.0 → 4.0.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.
Files changed (75) hide show
  1. package/dist/auth-privy.cjs.js +1 -1
  2. package/dist/auth-privy.js +1 -1
  3. package/dist/components/ProviderLogins/index.d.ts +0 -2
  4. package/dist/components/SpiceLock/lib/executors.d.ts +6 -1
  5. package/dist/components/SpiceLock/parts/LabeledInfoRow.d.ts +5 -0
  6. package/dist/components/SpiceSupply/lib/buildBatches.d.ts +3 -3
  7. package/dist/components/SpiceSupply/lib/executors.d.ts +5 -5
  8. package/dist/components/SpiceSupply/lib/feePreview.d.ts +5 -5
  9. package/dist/components/SpiceWithdraw/lib/executors.d.ts +4 -4
  10. package/dist/components/SpiceWithdraw/lib/feePreview.d.ts +2 -2
  11. package/dist/components/index.d.ts +0 -1
  12. package/dist/components/ui/index.d.ts +0 -1
  13. package/dist/execution/batchHashes.d.ts +2 -0
  14. package/dist/execution/fundEmbeddedWallet.d.ts +10 -0
  15. package/dist/execution/intentStatus.d.ts +31 -0
  16. package/dist/execution/pollIntentStep.d.ts +10 -0
  17. package/dist/execution/runner.d.ts +7 -0
  18. package/dist/execution/stripFeeCalls.d.ts +3 -0
  19. package/dist/execution/switchChain.d.ts +5 -0
  20. package/dist/hooks/index.d.ts +3 -7
  21. package/dist/hooks/useDirectWithdraw.d.ts +2 -2
  22. package/dist/hooks/useSpiceExecution.d.ts +12 -7
  23. package/dist/hooks/useSupplyAssets.d.ts +9 -7
  24. package/dist/hooks/{useWallet/index.d.ts → useWallet.d.ts} +2 -2
  25. package/dist/index.cjs.js +12 -12
  26. package/dist/index.d.ts +3 -15
  27. package/dist/index.js +12 -12
  28. package/dist/privy-2vbGci0p.js +0 -0
  29. package/dist/privy-BdHp5Owr.js +0 -0
  30. package/dist/providers/SpiceFlowProvider.d.ts +5 -3
  31. package/dist/types/lock.d.ts +3 -9
  32. package/dist/types/theme.d.ts +15 -13
  33. package/dist/types/wallet.d.ts +0 -11
  34. package/dist/utils/crossChainRouter/executeSwapThenAction.d.ts +4 -4
  35. package/dist/{hooks/directWithdrawPlan.d.ts → utils/directWithdraw.d.ts} +4 -0
  36. package/dist/utils/fees.d.ts +3 -1
  37. package/dist/utils/providerWallet.d.ts +2 -17
  38. package/dist/utils/relayer/index.d.ts +1 -0
  39. package/dist/utils/sleep.d.ts +1 -0
  40. package/dist/utils/swapQuotes.d.ts +0 -1
  41. package/dist/utils/theme.d.ts +2 -14
  42. package/dist/utils/tokenMetadata.d.ts +14 -0
  43. package/package.json +1 -23
  44. package/dist/Button-BtGAHwBv.js +0 -0
  45. package/dist/Button-D0J3UV89.js +0 -0
  46. package/dist/auth-dynamic.cjs.js +0 -2
  47. package/dist/auth-dynamic.js +0 -2
  48. package/dist/components/ExportWallet/ExportWalletButton.d.ts +0 -4
  49. package/dist/components/ExportWallet/index.d.ts +0 -2
  50. package/dist/components/ProviderLogins/parts/DynamicLogin.d.ts +0 -4
  51. package/dist/components/SdkErrorBoundary/SdkErrorBoundary.d.ts +0 -21
  52. package/dist/components/SdkErrorBoundary/index.d.ts +0 -1
  53. package/dist/components/SpiceBalance/SpiceBalance.d.ts +0 -3
  54. package/dist/components/SpiceBalance/index.d.ts +0 -4
  55. package/dist/components/SpiceBalance/parts/AccountItem.d.ts +0 -11
  56. package/dist/components/SpiceBalance/parts/BalanceSection.d.ts +0 -10
  57. package/dist/components/SpiceBalance/types.d.ts +0 -66
  58. package/dist/components/SpiceLock/parts/LockExpiryRow.d.ts +0 -4
  59. package/dist/components/SpiceLock/parts/VotingPowerRow.d.ts +0 -4
  60. package/dist/components/SpicePay/SpicePay.d.ts +0 -14
  61. package/dist/components/SpicePay/index.d.ts +0 -1
  62. package/dist/components/SpiceWalletNotice/SpiceWalletNotice.d.ts +0 -35
  63. package/dist/components/SpiceWalletNotice/index.d.ts +0 -2
  64. package/dist/components/ui/Modal.d.ts +0 -3
  65. package/dist/execution/gasless.d.ts +0 -7
  66. package/dist/hooks/directWithdrawGate.d.ts +0 -4
  67. package/dist/hooks/useEmbeddedWalletAddress.d.ts +0 -2
  68. package/dist/hooks/useSpiceAction.d.ts +0 -55
  69. package/dist/hooks/useStatus.d.ts +0 -27
  70. package/dist/hooks/useWallet/useDynamicWallet.d.ts +0 -2
  71. package/dist/providers/dynamic.d.ts +0 -3
  72. package/dist/providers/whitelistGate.d.ts +0 -33
  73. package/dist/utils/portal/index.d.ts +0 -14
  74. package/dist/utils/rebalancing/index.d.ts +0 -70
  75. package/dist/utils/retry/index.d.ts +0 -1
Binary file
Binary file
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
+ import type { Address } from "viem";
2
3
  import type { SpiceTheme } from "../types/theme";
3
4
  import { type PartnerWhitelistCheckResponse, type UseIsUserWhitelistedOptions } from "../hooks/useIsUserWhitelisted";
4
- export type WalletProvider = "privy" | "dynamic";
5
+ export type WalletProvider = "privy";
5
6
  export type SpiceFlowMode = "7702" | "presign" | "ondemand";
6
7
  export declare const hasStoredSpiceFlowMode: () => boolean;
7
8
  import type { Network } from "@spicenet-io/spiceflow-core";
@@ -24,6 +25,8 @@ export interface SpiceFlowProviderContextValue {
24
25
  appName?: string;
25
26
  apiUrl?: string;
26
27
  rpcOverrides?: Record<number, string>;
28
+ embeddedWalletAddress?: Address;
29
+ externalWalletAddress?: Address;
27
30
  isUserWhitelisted: boolean | null;
28
31
  isWhitelistChecking: boolean;
29
32
  isWhitelistConfigured: boolean;
@@ -33,9 +36,8 @@ export interface SpiceFlowProviderContextValue {
33
36
  export declare const SpiceFlowProviderContext: React.Context<SpiceFlowProviderContextValue | null>;
34
37
  export interface SpiceFlowProviderProps {
35
38
  children: React.ReactNode;
36
- provider: WalletProvider;
39
+ provider?: WalletProvider;
37
40
  privyAppId?: string;
38
- dynamicEnvironmentId?: string;
39
41
  supportedChainIds?: number[];
40
42
  allowedTokens?: string[];
41
43
  network?: SpiceFlowNetwork;
@@ -65,15 +65,9 @@ export interface LockDurationSliderProps {
65
65
  textSecondary?: string;
66
66
  trackColor?: string;
67
67
  }
68
- export interface LockExpiryRowProps {
69
- durationMonths: number | undefined;
70
- fontFamily: string;
71
- dark?: boolean;
72
- textPrimary?: string;
73
- textSecondary?: string;
74
- }
75
- export interface VotingPowerRowProps {
76
- votes: number | undefined;
68
+ export interface LabeledInfoRowProps {
69
+ label: string;
70
+ value: string;
77
71
  fontFamily: string;
78
72
  dark?: boolean;
79
73
  textPrimary?: string;
@@ -19,7 +19,21 @@ export interface SpiceTheme {
19
19
  appName?: string;
20
20
  logo?: React.ReactNode;
21
21
  }
22
- export interface ResolvedSpiceTheme {
22
+ export interface StatusColors {
23
+ successBg: string;
24
+ successBorder: string;
25
+ successText: string;
26
+ warningBg: string;
27
+ warningBorder: string;
28
+ warningText: string;
29
+ errorBg: string;
30
+ errorBorder: string;
31
+ errorText: string;
32
+ infoBg: string;
33
+ infoBorder: string;
34
+ infoText: string;
35
+ }
36
+ export interface ResolvedSpiceTheme extends StatusColors {
23
37
  primaryColor: string;
24
38
  dark: boolean;
25
39
  shell: string;
@@ -39,18 +53,6 @@ export interface ResolvedSpiceTheme {
39
53
  fontFamily: string;
40
54
  appName: string;
41
55
  logo?: React.ReactNode;
42
- successBg: string;
43
- successBorder: string;
44
- successText: string;
45
- warningBg: string;
46
- warningBorder: string;
47
- warningText: string;
48
- errorBg: string;
49
- errorBorder: string;
50
- errorText: string;
51
- infoBg: string;
52
- infoBorder: string;
53
- infoText: string;
54
56
  }
55
57
  export interface ButtonTheme {
56
58
  backgroundColor?: string;
@@ -29,9 +29,6 @@ export interface ProviderConfig {
29
29
  createOnLogin?: "off" | "users-without-wallets" | "all-users";
30
30
  };
31
31
  };
32
- dynamic?: {
33
- environmentId: string;
34
- };
35
32
  }
36
33
  export interface WalletProviderProps {
37
34
  children: React.ReactNode;
@@ -50,11 +47,3 @@ export interface LoginProps {
50
47
  export type WalletLoginProps = LoginProps;
51
48
  export type ProviderLoginProps = LoginProps;
52
49
  export type PrivyLoginProps = LoginProps;
53
- export type DynamicLoginProps = LoginProps;
54
- export interface ExportWalletButtonProps {
55
- label?: string;
56
- style?: React.CSSProperties;
57
- className?: string;
58
- onExport?: () => void;
59
- onError?: (error: string) => void;
60
- }
@@ -1,6 +1,6 @@
1
1
  import type { Call, ChainBatch } from "../../types/authorization";
2
- import type { GaslessExecutionOptions, OnProgress } from "../../hooks/useSpiceExecution";
3
- export type ExecuteGaslessFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
2
+ import type { ExecutionOptions, OnProgress } from "../../hooks/useSpiceExecution";
3
+ export type ExecuteFn = (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: OnProgress, signal?: AbortSignal, options?: ExecutionOptions) => Promise<string>;
4
4
  export interface SwapThenActionParams {
5
5
  chainId: number;
6
6
  swapCalls: Call[];
@@ -10,8 +10,8 @@ export interface SwapThenActionParams {
10
10
  tokenTransferAmount: bigint;
11
11
  onProgress?: OnProgress;
12
12
  signal?: AbortSignal;
13
- options?: GaslessExecutionOptions;
13
+ options?: ExecutionOptions;
14
14
  buffers?: bigint[];
15
15
  }
16
16
  export declare function applyBuffer(amount: bigint, buffer: bigint): bigint;
17
- export declare function executeSwapThenAction(executeGasless: ExecuteGaslessFn, params: SwapThenActionParams): Promise<string>;
17
+ export declare function executeSwapThenAction(execute: ExecuteFn, params: SwapThenActionParams): Promise<string>;
@@ -1,4 +1,8 @@
1
1
  import type { Address } from "viem";
2
+ export declare function canDirectWithdraw(args: {
3
+ embeddedAddress?: string;
4
+ externalAddress?: string;
5
+ }): boolean;
2
6
  export type Transfer = {
3
7
  recipient: Address;
4
8
  amount: bigint;
@@ -1,7 +1,9 @@
1
- import type { Address } from "viem";
1
+ import { type Address } from "viem";
2
2
  import type { FeeEstimateBatch, FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
3
3
  import type { FeePreview } from "../types/ui";
4
4
  export declare function calculateBpsFee(amount: bigint, bps: bigint): bigint;
5
+ export declare function amountsWithinBps(left: bigint, right: bigint, bps: bigint): boolean;
6
+ export declare function formatRawTokenInput(amount: bigint, decimals: number): string;
5
7
  export declare function getBatchFees(batch: FeeEstimateBatch): {
6
8
  spicenetFee: bigint;
7
9
  gasFee: bigint;
@@ -1,19 +1,4 @@
1
- import { Address } from "viem";
2
- export declare const getDynamicEmbeddedWallet: (dynamicContext: any) => any;
3
- export declare const getDynamicExternalWallet: (dynamicContext: any) => any;
1
+ import { type Address } from "viem";
2
+ export declare const getPrivyUserEmbeddedWalletAddress: (user: any) => Address | undefined;
4
3
  export declare const getProviderWalletClient: (wallet: any, chainId?: number) => Promise<any>;
5
4
  export declare const getProviderEthereumProvider: (wallet: any, chainId?: number) => Promise<any>;
6
- export declare const normalizeAuthorization: (authorization: any, fallback: {
7
- address: Address;
8
- chainId: number;
9
- contractAddress: Address;
10
- nonce: number;
11
- }) => {
12
- address: Address;
13
- chainId: number;
14
- contractAddress: Address;
15
- nonce: bigint;
16
- r: string;
17
- s: string;
18
- yParity: any;
19
- };
@@ -7,6 +7,7 @@ export declare class RelayerService {
7
7
  private baseUrl;
8
8
  setBaseUrl(url: string): void;
9
9
  getBaseUrl(): string;
10
+ private postJson;
10
11
  createAction(request: CreateActionRequest): Promise<CreateActionResponse>;
11
12
  estimateActionFees(request: CreateActionRequest): Promise<FeeEstimateSummary>;
12
13
  estimateBatchGas(request: {
@@ -0,0 +1 @@
1
+ export declare const sleep: (ms: number) => Promise<void>;
@@ -16,7 +16,6 @@ export interface ResolvedExactOutputSwap {
16
16
  export interface ExactOutputVenue {
17
17
  name: string;
18
18
  chainIds: number[];
19
- preferred?: boolean;
20
19
  resolve: (intent: ExactOutputSwapIntent, chainId: number, recipient: Address) => Promise<ResolvedExactOutputSwap | null>;
21
20
  }
22
21
  export interface ExactOutputRegistry {
@@ -1,5 +1,5 @@
1
- import type { SpiceTheme, ResolvedSpiceTheme } from "../types/theme";
2
- export interface ResolvedDarkPalette {
1
+ import type { SpiceTheme, ResolvedSpiceTheme, StatusColors } from "../types/theme";
2
+ export interface ResolvedDarkPalette extends StatusColors {
3
3
  shell: string;
4
4
  shellBorder: string;
5
5
  shellInnerBorder: string;
@@ -13,18 +13,6 @@ export interface ResolvedDarkPalette {
13
13
  cardBorder: string;
14
14
  inputBorder: string;
15
15
  buttonBorder: string;
16
- successBg: string;
17
- successBorder: string;
18
- successText: string;
19
- warningBg: string;
20
- warningBorder: string;
21
- warningText: string;
22
- errorBg: string;
23
- errorBorder: string;
24
- errorText: string;
25
- infoBg: string;
26
- infoBorder: string;
27
- infoText: string;
28
16
  }
29
17
  export declare function buildDarkPalette(primaryColor: string, overrides?: Partial<ResolvedDarkPalette>): ResolvedDarkPalette;
30
18
  export declare function buildLightPalette(primaryColor: string): ResolvedDarkPalette;
@@ -0,0 +1,14 @@
1
+ import { type Address } from "viem";
2
+ import { readContract } from "viem/actions";
3
+ export type TokenMetadata = {
4
+ decimals: number;
5
+ symbol: string;
6
+ name: string;
7
+ logoURI: string | undefined;
8
+ };
9
+ export declare function readTokenMetadata(client: Parameters<typeof readContract>[0], address: Address, configToken?: {
10
+ decimals: number;
11
+ symbol: string;
12
+ name: string;
13
+ logo?: string;
14
+ }): Promise<TokenMetadata>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "3.3.85-next.0",
3
+ "version": "4.0.0",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.13",
@@ -18,11 +18,6 @@
18
18
  "import": "./dist/auth-privy.js",
19
19
  "require": "./dist/auth-privy.cjs.js"
20
20
  },
21
- "./auth/dynamic": {
22
- "types": "./dist/providers/dynamic.d.ts",
23
- "import": "./dist/auth-dynamic.js",
24
- "require": "./dist/auth-dynamic.cjs.js"
25
- },
26
21
  "./styles.css": "./dist/providers/custom.css"
27
22
  },
28
23
  "sideEffects": [
@@ -30,8 +25,6 @@
30
25
  "./dist/index.cjs.js",
31
26
  "./dist/auth-privy.js",
32
27
  "./dist/auth-privy.cjs.js",
33
- "./dist/auth-dynamic.js",
34
- "./dist/auth-dynamic.cjs.js",
35
28
  "./dist/providers/custom.css"
36
29
  ],
37
30
  "files": [
@@ -63,9 +56,6 @@
63
56
  "tslib": "2.8.1"
64
57
  },
65
58
  "peerDependencies": {
66
- "@dynamic-labs/ethereum": ">=4.15.0 <5.0.0",
67
- "@dynamic-labs/sdk-react-core": ">=4.15.0 <5.0.0",
68
- "@dynamic-labs/wallet-connector-core": ">=4.15.0 <5.0.0",
69
59
  "@privy-io/react-auth": ">=2.24.0 <4.0.0",
70
60
  "@tanstack/react-query": ">=5.0.0",
71
61
  "axios": ">=1.0.0",
@@ -75,23 +65,11 @@
75
65
  "wagmi": ">=2.12.0"
76
66
  },
77
67
  "peerDependenciesMeta": {
78
- "@dynamic-labs/ethereum": {
79
- "optional": true
80
- },
81
- "@dynamic-labs/sdk-react-core": {
82
- "optional": true
83
- },
84
- "@dynamic-labs/wallet-connector-core": {
85
- "optional": true
86
- },
87
68
  "@privy-io/react-auth": {
88
69
  "optional": true
89
70
  }
90
71
  },
91
72
  "devDependencies": {
92
- "@dynamic-labs/ethereum": "4.70.0",
93
- "@dynamic-labs/sdk-react-core": "4.70.0",
94
- "@dynamic-labs/wallet-connector-core": "4.70.0",
95
73
  "@privy-io/react-auth": "2.25.0",
96
74
  "@rollup/plugin-commonjs": "28.0.9",
97
75
  "@rollup/plugin-image": "3.0.3",
Binary file
Binary file
@@ -1,2 +0,0 @@
1
- "use client";
2
- "use strict";const e=require("react/jsx-runtime"),c=require("react"),t=require("./Button-BtGAHwBv.js"),k=require("@dynamic-labs/sdk-react-core");require("@spicenet-io/spiceflow-core"),require("viem"),require("viem/actions"),require("@tanstack/react-query"),require("@privy-io/react-auth"),require("wagmi");const L=({onAuthSuccess:a,onAuthError:r,theme:h="light",className:i="",buttonText:o="Login with Dynamic",autoTrigger:l=!1})=>{const s=t.createTheme(h),[m,D]=c.useState(!1),[g,S]=c.useState(!1),w=k.useDynamicContext(),{user:E,primaryWallet:f,connectedWallets:b,handleLogOut:q,setShowAuthFlow:x,sdkHasLoaded:p,showAuthFlow:j}=w,n=(t.getDynamicEmbeddedWallet({connectedWallets:b,primaryWallet:f})||f)?.address,v=!!E,d=v&&!!n;c.useEffect(()=>{D(!0)},[]),c.useEffect(()=>{d&&n&&a&&a(n)},[d,n,a]),c.useEffect(()=>{l&&p&&m&&!d&&!j&&!g&&(S(!0),x(!0))},[l,p,m,d,j,g,x]);const C=()=>{try{x(!0)}catch(y){const u=`Dynamic login failed: ${String(y)}`;r?r(u):console.error(u)}},N=async()=>{try{await q()}catch(y){const u=`Dynamic logout failed: ${String(y)}`;r?r(u):console.error(u)}};return m?p?v&&!n?e.jsx("div",{className:i,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[e.jsx(t.Spinner,{size:40,borderWidth:3,color:s.colors.primary}),e.jsx("p",{style:{color:s.colors.textMuted,fontSize:"14px"},children:"Finishing wallet setup..."})]})}):d&&n?e.jsx("div",{className:i,children:e.jsxs(t.Button,{variant:"primary",onClick:N,theme:s,children:["Logout (",n.slice(0,6),"...",n.slice(-4),")"]})}):l?e.jsx("div",{className:i,children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[e.jsx(t.Spinner,{size:40,borderWidth:3,color:s.colors.primary}),e.jsx("p",{style:{color:s.colors.textMuted,fontSize:"14px"},children:"Opening login..."})]})}):e.jsx("div",{className:i,children:e.jsx(t.Button,{variant:"primary",onClick:C,theme:s,children:o})}):e.jsx("div",{className:i,children:e.jsx(t.Button,{variant:"primary",disabled:!0,theme:s,children:"Loading..."})}):e.jsx("div",{className:i,children:e.jsx(t.Button,{variant:"primary",disabled:!0,theme:s,children:o})})};class W extends c.Component{constructor(r){super(r),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}}const B=a=>{const{theme:r="light",className:h="",buttonText:i="Login with Dynamic",onAuthError:o}=a,l=t.createTheme(r);return e.jsx(W,{fallback:e.jsx("div",{className:h,children:e.jsx(t.Button,{variant:"primary",onClick:()=>{o&&o('DynamicLogin must be used within SpiceFlowProvider provider="dynamic" and a mounted DynamicContextProvider.')},theme:l,children:i})}),children:e.jsx(L,{...a})})};exports.DynamicLogin=B;
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{jsx as e,jsxs as g}from"react/jsx-runtime";import A,{useState as N,useEffect as f}from"react";import{B as d,c as S,g as j,S as b}from"./Button-D0J3UV89.js";import{useDynamicContext as z}from"@dynamic-labs/sdk-react-core";import"@spicenet-io/spiceflow-core";import"viem";import"viem/actions";import"@tanstack/react-query";import"@privy-io/react-auth";import"wagmi";const M=({onAuthSuccess:a,onAuthError:t,theme:m="light",className:r="",buttonText:o="Login with Dynamic",autoTrigger:s=!1})=>{const i=S(m),[h,C]=N(!1),[x,E]=N(!1),k=z(),{user:L,primaryWallet:v,connectedWallets:W,handleLogOut:F,setShowAuthFlow:p,sdkHasLoaded:u,showAuthFlow:D}=k,n=(j({connectedWallets:W,primaryWallet:v})||v)?.address,w=!!L,l=w&&!!n;return f(()=>{C(!0)},[]),f(()=>{l&&n&&a&&a(n)},[l,n,a]),f(()=>{s&&u&&h&&!l&&!D&&!x&&(E(!0),p(!0))},[s,u,h,l,D,x,p]),h?u?w&&!n?e("div",{className:r,children:g("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[e(b,{size:40,borderWidth:3,color:i.colors.primary}),e("p",{style:{color:i.colors.textMuted,fontSize:"14px"},children:"Finishing wallet setup..."})]})}):l&&n?e("div",{className:r,children:g(d,{variant:"primary",onClick:async()=>{try{await F()}catch(y){const c=`Dynamic logout failed: ${String(y)}`;t?t(c):console.error(c)}},theme:i,children:["Logout (",n.slice(0,6),"...",n.slice(-4),")"]})}):s?e("div",{className:r,children:g("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"20px",flexDirection:"column",gap:"12px"},children:[e(b,{size:40,borderWidth:3,color:i.colors.primary}),e("p",{style:{color:i.colors.textMuted,fontSize:"14px"},children:"Opening login..."})]})}):e("div",{className:r,children:e(d,{variant:"primary",onClick:()=>{try{p(!0)}catch(y){const c=`Dynamic login failed: ${String(y)}`;t?t(c):console.error(c)}},theme:i,children:o})}):e("div",{className:r,children:e(d,{variant:"primary",disabled:!0,theme:i,children:"Loading..."})}):e("div",{className:r,children:e(d,{variant:"primary",disabled:!0,theme:i,children:o})})};class T extends A.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}}const B=a=>{const{theme:t="light",className:m="",buttonText:r="Login with Dynamic",onAuthError:o}=a,s=S(t);return e(T,{fallback:e("div",{className:m,children:e(d,{variant:"primary",onClick:()=>{o&&o('DynamicLogin must be used within SpiceFlowProvider provider="dynamic" and a mounted DynamicContextProvider.')},theme:s,children:r})}),children:e(M,{...a})})};export{B as DynamicLogin};
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { ExportWalletButtonProps } from "../../types/wallet";
3
- export type { ExportWalletButtonProps };
4
- export declare const ExportWalletButton: React.FC<ExportWalletButtonProps>;
@@ -1,2 +0,0 @@
1
- export { ExportWalletButton } from "./ExportWalletButton";
2
- export type { ExportWalletButtonProps } from "./ExportWalletButton";
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { DynamicLoginProps } from "../../../types/wallet";
3
- export type { DynamicLoginProps };
4
- export declare const DynamicLogin: React.FC<DynamicLoginProps>;
@@ -1,21 +0,0 @@
1
- import React from "react";
2
- interface SdkErrorBoundaryProps {
3
- children: React.ReactNode;
4
- fallback?: React.ReactNode;
5
- componentName?: string;
6
- dark?: boolean;
7
- }
8
- interface SdkErrorBoundaryState {
9
- hasError: boolean;
10
- error: Error | null;
11
- retryCount: number;
12
- }
13
- export declare class SdkErrorBoundary extends React.Component<SdkErrorBoundaryProps, SdkErrorBoundaryState> {
14
- constructor(props: SdkErrorBoundaryProps);
15
- static getDerivedStateFromError(error: Error): Partial<SdkErrorBoundaryState>;
16
- componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
17
- private static MAX_RETRIES;
18
- private handleRetry;
19
- render(): React.ReactNode;
20
- }
21
- export {};
@@ -1 +0,0 @@
1
- export { SdkErrorBoundary } from "./SdkErrorBoundary";
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { SpiceBalanceProps } from "./types";
3
- export declare const SpiceBalance: React.FC<SpiceBalanceProps>;
@@ -1,4 +0,0 @@
1
- export { SpiceBalance } from "./SpiceBalance";
2
- export { BalanceSection } from "./parts/BalanceSection";
3
- export { AccountItem } from "./parts/AccountItem";
4
- export type { SpiceBalanceProps, BalanceData, TradingAccount, BalanceSectionConfig, SpiceBalanceApiResponse, } from "./types";
@@ -1,11 +0,0 @@
1
- import React from "react";
2
- interface AccountItemProps {
3
- name: string;
4
- balance: string;
5
- icon?: React.ReactNode | string;
6
- subtitle?: string;
7
- networks?: number[];
8
- onClick?: () => void;
9
- }
10
- export declare const AccountItem: React.FC<AccountItemProps>;
11
- export {};
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- interface BalanceSectionProps {
3
- title: string;
4
- icon?: any;
5
- amount: string;
6
- children?: React.ReactNode;
7
- defaultExpanded?: boolean;
8
- }
9
- export declare const BalanceSection: React.FC<BalanceSectionProps>;
10
- export {};
@@ -1,66 +0,0 @@
1
- import type { CustomStyles } from "../../types/theme";
2
- export interface SpiceBalanceApiResponse {
3
- success: boolean;
4
- data?: {
5
- tokens: Array<{
6
- chainId: number;
7
- tokenAddress: string;
8
- amount: string;
9
- }>;
10
- };
11
- }
12
- export interface TradingAccount {
13
- id: string;
14
- name: string;
15
- balance: number;
16
- icon?: string;
17
- }
18
- export interface AccountItem {
19
- id: string;
20
- name: string;
21
- balance: number;
22
- subtitle?: string;
23
- iconColor?: string;
24
- networks?: number[];
25
- }
26
- export interface BalanceSectionConfig {
27
- id: string;
28
- title: string;
29
- icon?: string;
30
- items?: AccountItem[];
31
- totalBalance?: number;
32
- defaultExpanded?: boolean;
33
- fetchBalance?: () => Promise<number>;
34
- emptyMessage?: string;
35
- }
36
- export interface BalanceData {
37
- totalBalance: number;
38
- percentageChange?: number;
39
- tradingAccounts: TradingAccount[];
40
- freeCollateral: number;
41
- freeCollateralItems?: AccountItem[];
42
- defiPositions: number;
43
- defiPositionsItems?: AccountItem[];
44
- credit: number;
45
- creditItems?: AccountItem[];
46
- }
47
- export interface SpiceBalanceProps {
48
- balanceData: BalanceData;
49
- isLoading?: boolean;
50
- onRefresh?: () => void;
51
- styles?: CustomStyles;
52
- className?: string;
53
- showHeader?: boolean;
54
- headerTitle?: string;
55
- onAccountClick?: (accountId: string) => void;
56
- onDepositClick?: () => void;
57
- onWithdrawClick?: () => void;
58
- vaultBalance?: number;
59
- fetchVaultBalance?: () => Promise<number>;
60
- onWithdrawExecute?: (amount: string) => Promise<void> | void;
61
- withdrawActionLabel?: string;
62
- destinationChainId?: number;
63
- destinationTokenAddress?: string;
64
- customSections?: BalanceSectionConfig[];
65
- showDefaultSections?: boolean;
66
- }
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { LockExpiryRowProps } from "../../../types/lock";
3
- export type { LockExpiryRowProps };
4
- export declare const LockExpiryRow: React.NamedExoticComponent<LockExpiryRowProps>;
@@ -1,4 +0,0 @@
1
- import React from "react";
2
- import type { VotingPowerRowProps } from "../../../types/lock";
3
- export type { VotingPowerRowProps };
4
- export declare const VotingPowerRow: React.NamedExoticComponent<VotingPowerRowProps>;
@@ -1,14 +0,0 @@
1
- import React from "react";
2
- import type { Address } from "viem";
3
- import type { SpiceSupplyProps } from "../../types/supply";
4
- export type SpicePayProps = Omit<SpiceSupplyProps, "amountDirection" | "destinationToken" | "actionLabel" | "swapDescription" | "directDescription" | "onSuccess" | "onError"> & {
5
- paymentTokenAddress: Address;
6
- paymentTokenSymbol: string;
7
- paymentTokenDecimals: number;
8
- paymentTokenLogoURI?: string;
9
- paymentChainId: number;
10
- ctaLabel?: string;
11
- onPaymentSuccess?: (txHash?: string) => void;
12
- onPaymentError?: (error: Error) => void;
13
- };
14
- export declare const SpicePay: React.FC<SpicePayProps>;
@@ -1 +0,0 @@
1
- export { SpicePay } from "./SpicePay";
@@ -1,35 +0,0 @@
1
- import React from "react";
2
- import type { CustomStyles } from "../../types/theme";
3
- export interface WalletNoticeContentContext {
4
- whitelisted: boolean;
5
- address?: string;
6
- shortAddress: string;
7
- appName: string;
8
- }
9
- export interface WalletNoticeContent {
10
- title: React.ReactNode;
11
- body: React.ReactNode;
12
- }
13
- export interface WalletNoticeSheetProps {
14
- isOpen: boolean;
15
- whitelisted: boolean;
16
- address?: string;
17
- onClose: () => void;
18
- appName?: string;
19
- tokens?: string;
20
- chains?: string[];
21
- renderContent?: (ctx: WalletNoticeContentContext) => WalletNoticeContent;
22
- styles?: CustomStyles;
23
- dark?: boolean;
24
- }
25
- export declare const WalletNoticeSheet: React.FC<WalletNoticeSheetProps>;
26
- export interface SpiceWalletNoticeProps {
27
- styles?: CustomStyles;
28
- dark?: boolean;
29
- appName?: string;
30
- tokens?: string;
31
- chains?: string[];
32
- renderContent?: (ctx: WalletNoticeContentContext) => WalletNoticeContent;
33
- onClose?: () => void;
34
- }
35
- export declare const SpiceWalletNotice: React.FC<SpiceWalletNoticeProps>;
@@ -1,2 +0,0 @@
1
- export { SpiceWalletNotice } from "./SpiceWalletNotice";
2
- export type { SpiceWalletNoticeProps, WalletNoticeContent, WalletNoticeContentContext, } from "./SpiceWalletNotice";
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import type { ModalProps } from "../../types/ui";
3
- export declare const Modal: React.FC<ModalProps>;
@@ -1,7 +0,0 @@
1
- import type { FeeEstimateSummary } from "@spicenet-io/spiceflow-core";
2
- import type { ChainBatch } from "../types/authorization";
3
- import type { GaslessExecutionOptions, GaslessProgress } from "../hooks/useSpiceExecution";
4
- export type GaslessRunner = {
5
- estimateGasless: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, options?: GaslessExecutionOptions) => Promise<FeeEstimateSummary>;
6
- executeGasless: (chainBatches: ChainBatch[], tokenAddress: string, tokenTransferAmount: bigint, onProgress?: (progress: GaslessProgress) => void, signal?: AbortSignal, options?: GaslessExecutionOptions) => Promise<string>;
7
- };
@@ -1,4 +0,0 @@
1
- export declare function canDirectWithdraw(args: {
2
- embeddedAddress?: string;
3
- externalAddress?: string;
4
- }): boolean;
@@ -1,2 +0,0 @@
1
- import { Address } from "viem";
2
- export declare const useEmbeddedWalletAddress: () => Address | undefined;
@@ -1,55 +0,0 @@
1
- import { type Address } from "viem";
2
- import { type SupplyStep, type PaymentResult } from "../components/SpiceSupply/lib/executors";
3
- import type { SpiceSupplyProps, DestinationTokenConfig } from "../types/supply";
4
- import type { Asset, SelectedAsset } from "../types/assets";
5
- import type { FeePreview } from "../types/ui";
6
- export interface UseSpiceActionOpts {
7
- destinationToken: DestinationTokenConfig;
8
- recipient?: Address;
9
- buildActionCalls: SpiceSupplyProps["buildActionCalls"];
10
- buildSpicenetBatch?: SpiceSupplyProps["buildSpicenetBatch"];
11
- amountMode: "exact-input" | "exact-output";
12
- amount: string;
13
- sourceChains?: number[];
14
- supportedSourceAssets?: string[];
15
- feeExecutionMode?: SpiceSupplyProps["feeExecutionMode"];
16
- enabled?: boolean;
17
- onSuccess?: (txHash: string) => void;
18
- onError?: (e: Error) => void;
19
- }
20
- export interface SpiceActionQuote {
21
- isQuoting: boolean;
22
- error: string | null;
23
- estimatedInput: string | null;
24
- estimatedOutput: string | null;
25
- isDirect: boolean;
26
- needsSwap: boolean;
27
- }
28
- export interface UseSpiceActionReturn {
29
- sources: (Asset & {
30
- _source?: "wallet" | "spice";
31
- _fundingWallet?: "embedded" | "external";
32
- })[];
33
- selectedAsset: SelectedAsset | null;
34
- setSelectedAsset: (a: SelectedAsset | null) => void;
35
- selectAsset: (asset: Asset) => void;
36
- quote: SpiceActionQuote;
37
- feePreview: FeePreview | null;
38
- isFeePreviewLoading: boolean;
39
- feePreviewError: string | null;
40
- canSubmit: boolean;
41
- execute: () => Promise<void>;
42
- isExecuting: boolean;
43
- step: SupplyStep;
44
- statusMsg: string;
45
- txHash: string | null;
46
- paymentResult: PaymentResult | null;
47
- refreshAssets: () => void;
48
- }
49
- export declare function useSpiceAction(opts: UseSpiceActionOpts): UseSpiceActionReturn;
50
- export type UseSupplyOpts = Omit<UseSpiceActionOpts, "amountMode">;
51
- export type UsePayOpts = Omit<UseSpiceActionOpts, "amountMode">;
52
- export type UseRepayOpts = Omit<UseSpiceActionOpts, "amountMode">;
53
- export declare function useSupply(opts: UseSupplyOpts): UseSpiceActionReturn;
54
- export declare function usePay(opts: UsePayOpts): UseSpiceActionReturn;
55
- export declare function useRepay(opts: UseRepayOpts): UseSpiceActionReturn;