@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.
@@ -2,11 +2,11 @@ import {
2
2
  bind_exports,
3
3
  poh_exports,
4
4
  user_exports
5
- } from "../../chunk-UGKYENZK.mjs";
5
+ } from "../../chunk-AZCOCC5H.mjs";
6
6
  import {
7
7
  isSuccess,
8
8
  wallet_exports
9
- } from "../../chunk-OSIGDX4D.mjs";
9
+ } from "../../chunk-ZHBFW26I.mjs";
10
10
  import "../../chunk-UA6XHZHX.mjs";
11
11
  import "../../chunk-FB5MHLWX.mjs";
12
12
  import "../../chunk-5JHHHLG4.mjs";
@@ -1432,39 +1432,15 @@ function TokenSend({
1432
1432
  const [sending, setSending] = (0, import_react23.useState)(false);
1433
1433
  const [txError, setTxError] = (0, import_react23.useState)("");
1434
1434
  const transaction = (0, import_react23.useMemo)(() => {
1435
- if (!amount || !address) {
1435
+ const reg = /^0x[a-fA-F0-9]{40}$/;
1436
+ if (!amount || !address || !reg.test(address)) {
1436
1437
  return;
1437
1438
  }
1438
- const abi = [
1439
- {
1440
- "constant": false,
1441
- "inputs": [
1442
- {
1443
- "name": "_to",
1444
- "type": "address"
1445
- },
1446
- {
1447
- "name": "_value",
1448
- "type": "uint256"
1449
- }
1450
- ],
1451
- "name": "transfer",
1452
- "outputs": [
1453
- {
1454
- "name": "",
1455
- "type": "bool"
1456
- }
1457
- ],
1458
- "payable": false,
1459
- "stateMutability": "nonpayable",
1460
- "type": "function"
1461
- }
1462
- ];
1463
1439
  const viemChain = (0, import_viem2.defineChain)(chain);
1464
1440
  const to = isNative ? address : token.address;
1465
1441
  const value = isNative ? (0, import_viem2.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
1466
1442
  const data = isNative ? "0x" : (0, import_viem2.encodeFunctionData)({
1467
- abi,
1443
+ abi: import_viem2.erc20Abi,
1468
1444
  functionName: "transfer",
1469
1445
  args: [address, (0, import_viem2.parseUnits)(amount, parseInt(token?.decimals || "18"))]
1470
1446
  });