@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.
@@ -12,7 +12,7 @@ import {
12
12
  useTransaction,
13
13
  useUserInfo,
14
14
  useWallet
15
- } from "../chunk-OSIGDX4D.mjs";
15
+ } from "../chunk-ZHBFW26I.mjs";
16
16
  import "../chunk-UA6XHZHX.mjs";
17
17
  import {
18
18
  useLayout_exports
package/dist/index.js CHANGED
@@ -5339,39 +5339,15 @@ function TokenSend({
5339
5339
  const [sending, setSending] = (0, import_react30.useState)(false);
5340
5340
  const [txError, setTxError] = (0, import_react30.useState)("");
5341
5341
  const transaction = (0, import_react30.useMemo)(() => {
5342
- if (!amount || !address) {
5342
+ const reg = /^0x[a-fA-F0-9]{40}$/;
5343
+ if (!amount || !address || !reg.test(address)) {
5343
5344
  return;
5344
5345
  }
5345
- const abi = [
5346
- {
5347
- "constant": false,
5348
- "inputs": [
5349
- {
5350
- "name": "_to",
5351
- "type": "address"
5352
- },
5353
- {
5354
- "name": "_value",
5355
- "type": "uint256"
5356
- }
5357
- ],
5358
- "name": "transfer",
5359
- "outputs": [
5360
- {
5361
- "name": "",
5362
- "type": "bool"
5363
- }
5364
- ],
5365
- "payable": false,
5366
- "stateMutability": "nonpayable",
5367
- "type": "function"
5368
- }
5369
- ];
5370
5346
  const viemChain = (0, import_viem6.defineChain)(chain);
5371
5347
  const to = isNative ? address : token.address;
5372
5348
  const value = isNative ? (0, import_viem6.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
5373
5349
  const data = isNative ? "0x" : (0, import_viem6.encodeFunctionData)({
5374
- abi,
5350
+ abi: import_viem6.erc20Abi,
5375
5351
  functionName: "transfer",
5376
5352
  args: [address, (0, import_viem6.parseUnits)(amount, parseInt(token?.decimals || "18"))]
5377
5353
  });