@matchain/matchid-sdk-react 0.1.48-alpha.28 → 0.1.48-alpha.29

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.
@@ -11,7 +11,7 @@ import {
11
11
  useUserInfo,
12
12
  verifyPohApi,
13
13
  wallet_exports
14
- } from "./chunk-OSIGDX4D.mjs";
14
+ } from "./chunk-ZHBFW26I.mjs";
15
15
  import {
16
16
  __export
17
17
  } from "./chunk-J5LGTIGS.mjs";
@@ -94,4 +94,4 @@ export {
94
94
  user_exports,
95
95
  api_exports
96
96
  };
97
- //# sourceMappingURL=chunk-UGKYENZK.mjs.map
97
+ //# sourceMappingURL=chunk-AZCOCC5H.mjs.map
@@ -5857,7 +5857,7 @@ function WalletAsset({
5857
5857
 
5858
5858
  // src/components/TokenSend/index.tsx
5859
5859
  import { useEffect as useEffect24, useMemo as useMemo15, useState as useState26 } from "react";
5860
- import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, http as http6, parseUnits as parseUnits2 } from "viem";
5860
+ import { defineChain as defineChain4, encodeFunctionData as encodeFunctionData2, erc20Abi as erc20Abi3, http as http6, parseUnits as parseUnits2 } from "viem";
5861
5861
  import { FormattedMessage as FormattedMessage11, useIntl as useIntl16 } from "react-intl";
5862
5862
  import { jsx as jsx30, jsxs as jsxs20 } from "react/jsx-runtime";
5863
5863
  function Input2({
@@ -5910,39 +5910,15 @@ function TokenSend({
5910
5910
  const [sending, setSending] = useState26(false);
5911
5911
  const [txError, setTxError] = useState26("");
5912
5912
  const transaction = useMemo15(() => {
5913
- if (!amount || !address) {
5913
+ const reg = /^0x[a-fA-F0-9]{40}$/;
5914
+ if (!amount || !address || !reg.test(address)) {
5914
5915
  return;
5915
5916
  }
5916
- const abi = [
5917
- {
5918
- "constant": false,
5919
- "inputs": [
5920
- {
5921
- "name": "_to",
5922
- "type": "address"
5923
- },
5924
- {
5925
- "name": "_value",
5926
- "type": "uint256"
5927
- }
5928
- ],
5929
- "name": "transfer",
5930
- "outputs": [
5931
- {
5932
- "name": "",
5933
- "type": "bool"
5934
- }
5935
- ],
5936
- "payable": false,
5937
- "stateMutability": "nonpayable",
5938
- "type": "function"
5939
- }
5940
- ];
5941
5917
  const viemChain = defineChain4(chain);
5942
5918
  const to = isNative ? address : token.address;
5943
5919
  const value = isNative ? parseUnits2(amount, parseInt(token?.decimals || "18")) : BigInt(0);
5944
5920
  const data = isNative ? "0x" : encodeFunctionData2({
5945
- abi,
5921
+ abi: erc20Abi3,
5946
5922
  functionName: "transfer",
5947
5923
  args: [address, parseUnits2(amount, parseInt(token?.decimals || "18"))]
5948
5924
  });
@@ -6217,7 +6193,7 @@ function TokenSendList({ close }) {
6217
6193
  import InfiniteScroll from "react-infinite-scroll-component";
6218
6194
  import { useEffect as useEffect25, useMemo as useMemo16, useState as useState28 } from "react";
6219
6195
  import { decodeFunctionData, defineChain as defineChain5, formatUnits as formatUnits3 } from "viem";
6220
- import { erc20Abi as erc20Abi3 } from "viem";
6196
+ import { erc20Abi as erc20Abi4 } from "viem";
6221
6197
  import { FormattedMessage as FormattedMessage14 } from "react-intl";
6222
6198
  import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
6223
6199
  var Item = ({ data }) => {
@@ -6242,7 +6218,7 @@ var Item = ({ data }) => {
6242
6218
  }
6243
6219
  if (transferType == "erc20_transfer") {
6244
6220
  const decodeData = decodeFunctionData({
6245
- abi: erc20Abi3,
6221
+ abi: erc20Abi4,
6246
6222
  data: data.input
6247
6223
  });
6248
6224
  return decodeData.args[0];
@@ -6252,7 +6228,7 @@ var Item = ({ data }) => {
6252
6228
  const amount = useMemo16(() => {
6253
6229
  if (transferType == "erc20_transfer") {
6254
6230
  const decodeData = decodeFunctionData({
6255
- abi: erc20Abi3,
6231
+ abi: erc20Abi4,
6256
6232
  data: data.input
6257
6233
  });
6258
6234
  const value = decodeData.args[1];
@@ -6403,4 +6379,4 @@ export {
6403
6379
  MatchProvider,
6404
6380
  useMatch
6405
6381
  };
6406
- //# sourceMappingURL=chunk-OSIGDX4D.mjs.map
6382
+ //# sourceMappingURL=chunk-ZHBFW26I.mjs.map