@spicenet-io/spiceflow-ui 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React, { useEffect, useState, useCallback } from 'react';
4
- import { c as createTheme, B as Button } from './Button-RifBkofT.js';
4
+ import { c as createTheme, B as Button } from './Button-aWXByNBC.js';
5
5
  import { useDynamicContext, useConnectWithOtp } from '@dynamic-labs/sdk-react-core';
6
6
 
7
7
  const Input = ({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useState, useEffect } from 'react';
4
- import { B as Button, c as createTheme } from './Button-RifBkofT.js';
4
+ import { B as Button, c as createTheme } from './Button-aWXByNBC.js';
5
5
  import { usePrivy, useLogin, useLogout } from '@privy-io/react-auth';
6
6
 
7
7
  const PrivyLogin = ({
package/dist/index.cjs.js CHANGED
@@ -3914,7 +3914,8 @@ const SwapWidget = ({
3914
3914
 
3915
3915
  const DepositWidget = ({
3916
3916
  depositBatches,
3917
- tokenAddress = "0x0",
3917
+ tokenAddress,
3918
+ tokenDecimals,
3918
3919
  supportedChains,
3919
3920
  theme: themeMode = "light",
3920
3921
  styles,
@@ -4104,7 +4105,10 @@ const DepositWidget = ({
4104
4105
  [
4105
4106
  {
4106
4107
  tokenAddress,
4107
- tokenAmount: viem.parseEther(selectedDepositAsset.amount)
4108
+ tokenAmount: viem.parseUnits(
4109
+ selectedDepositAsset.amount,
4110
+ tokenDecimals
4111
+ )
4108
4112
  }
4109
4113
  ]
4110
4114
  ]
@@ -4615,6 +4619,7 @@ const DepositWidgetModal = ({
4615
4619
  // Pass through all DepositWidget props
4616
4620
  depositBatches,
4617
4621
  tokenAddress,
4622
+ tokenDecimals,
4618
4623
  supportedChains,
4619
4624
  theme: themeMode = "light",
4620
4625
  styles,
@@ -4680,6 +4685,7 @@ const DepositWidgetModal = ({
4680
4685
  {
4681
4686
  depositBatches,
4682
4687
  tokenAddress,
4688
+ tokenDecimals,
4683
4689
  supportedChains,
4684
4690
  theme: themeMode,
4685
4691
  styles: {
@@ -11958,7 +11964,7 @@ const LpModal = ({
11958
11964
  };
11959
11965
 
11960
11966
  const useFromInput = () => {
11961
- const [fromAmount, setFromAmount] = React.useState("");
11967
+ const [fromAmount, setFromAmount] = React.useState("0");
11962
11968
  return {
11963
11969
  fromAmount,
11964
11970
  setFromAmount
@@ -11966,7 +11972,7 @@ const useFromInput = () => {
11966
11972
  };
11967
11973
 
11968
11974
  const useToInputUpdate = () => {
11969
- const [toAmount, setToAmount] = React.useState("");
11975
+ const [toAmount, setToAmount] = React.useState("0");
11970
11976
  const updateToAmount = React.useCallback((amount) => {
11971
11977
  setToAmount(amount);
11972
11978
  }, []);
@@ -11978,7 +11984,7 @@ const useToInputUpdate = () => {
11978
11984
  };
11979
11985
 
11980
11986
  const useDepositInput = () => {
11981
- const [depositAmount, setDepositAmount] = React.useState("");
11987
+ const [depositAmount, setDepositAmount] = React.useState("0");
11982
11988
  return {
11983
11989
  depositAmount,
11984
11990
  setDepositAmount
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import React, { useState, useRef, useEffect, useCallback, createContext, useContext, useTransition, forwardRef, createElement, useMemo } from 'react';
4
4
  import { defineChain, createPublicClient, http, isAddress, getAddress, parseEther, encodeFunctionData, parseUnits, erc20Abi } from 'viem';
5
- import { c as createTheme, B as Button, d as defaultTheme } from './Button-RifBkofT.js';
5
+ import { c as createTheme, B as Button, d as defaultTheme } from './Button-aWXByNBC.js';
6
6
  import { getBalance, readContract } from 'viem/actions';
7
7
  import { basecampTestnet, citreaTestnet, baseSepolia, arbitrumSepolia, sepolia } from 'viem/chains';
8
8
  import { createPortal } from 'react-dom';
@@ -3912,7 +3912,8 @@ const SwapWidget = ({
3912
3912
 
3913
3913
  const DepositWidget = ({
3914
3914
  depositBatches,
3915
- tokenAddress = "0x0",
3915
+ tokenAddress,
3916
+ tokenDecimals,
3916
3917
  supportedChains,
3917
3918
  theme: themeMode = "light",
3918
3919
  styles,
@@ -4102,7 +4103,10 @@ const DepositWidget = ({
4102
4103
  [
4103
4104
  {
4104
4105
  tokenAddress,
4105
- tokenAmount: parseEther(selectedDepositAsset.amount)
4106
+ tokenAmount: parseUnits(
4107
+ selectedDepositAsset.amount,
4108
+ tokenDecimals
4109
+ )
4106
4110
  }
4107
4111
  ]
4108
4112
  ]
@@ -4613,6 +4617,7 @@ const DepositWidgetModal = ({
4613
4617
  // Pass through all DepositWidget props
4614
4618
  depositBatches,
4615
4619
  tokenAddress,
4620
+ tokenDecimals,
4616
4621
  supportedChains,
4617
4622
  theme: themeMode = "light",
4618
4623
  styles,
@@ -4678,6 +4683,7 @@ const DepositWidgetModal = ({
4678
4683
  {
4679
4684
  depositBatches,
4680
4685
  tokenAddress,
4686
+ tokenDecimals,
4681
4687
  supportedChains,
4682
4688
  theme: themeMode,
4683
4689
  styles: {
@@ -11956,7 +11962,7 @@ const LpModal = ({
11956
11962
  };
11957
11963
 
11958
11964
  const useFromInput = () => {
11959
- const [fromAmount, setFromAmount] = useState("");
11965
+ const [fromAmount, setFromAmount] = useState("0");
11960
11966
  return {
11961
11967
  fromAmount,
11962
11968
  setFromAmount
@@ -11964,7 +11970,7 @@ const useFromInput = () => {
11964
11970
  };
11965
11971
 
11966
11972
  const useToInputUpdate = () => {
11967
- const [toAmount, setToAmount] = useState("");
11973
+ const [toAmount, setToAmount] = useState("0");
11968
11974
  const updateToAmount = useCallback((amount) => {
11969
11975
  setToAmount(amount);
11970
11976
  }, []);
@@ -11976,7 +11982,7 @@ const useToInputUpdate = () => {
11976
11982
  };
11977
11983
 
11978
11984
  const useDepositInput = () => {
11979
- const [depositAmount, setDepositAmount] = useState("");
11985
+ const [depositAmount, setDepositAmount] = useState("0");
11980
11986
  return {
11981
11987
  depositAmount,
11982
11988
  setDepositAmount
@@ -19,7 +19,8 @@ export interface SpiceDepositResponse {
19
19
  }
20
20
  export interface DepositWidgetProps {
21
21
  depositBatches: ChainBatch[];
22
- tokenAddress?: Address;
22
+ tokenAddress: Address;
23
+ tokenDecimals: number;
23
24
  supportedChains: number[];
24
25
  theme?: ThemeMode;
25
26
  styles?: CustomStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-ui",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Spiceflow UI SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
File without changes