@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.
- package/dist/{chunk-UGKYENZK.mjs → chunk-AZCOCC5H.mjs} +2 -2
- package/dist/{chunk-OSIGDX4D.mjs → chunk-ZHBFW26I.mjs} +8 -32
- package/dist/{chunk-OSIGDX4D.mjs.map → chunk-ZHBFW26I.mjs.map} +1 -1
- package/dist/components/index.js +3 -27
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/api/index.js.map +1 -1
- package/dist/hooks/api/index.mjs +2 -2
- package/dist/hooks/index.js +3 -27
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.js +3 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-UGKYENZK.mjs.map → chunk-AZCOCC5H.mjs.map} +0 -0
package/dist/components/index.js
CHANGED
|
@@ -5348,39 +5348,15 @@ function TokenSend({
|
|
|
5348
5348
|
const [sending, setSending] = (0, import_react38.useState)(false);
|
|
5349
5349
|
const [txError, setTxError] = (0, import_react38.useState)("");
|
|
5350
5350
|
const transaction = (0, import_react38.useMemo)(() => {
|
|
5351
|
-
|
|
5351
|
+
const reg = /^0x[a-fA-F0-9]{40}$/;
|
|
5352
|
+
if (!amount || !address || !reg.test(address)) {
|
|
5352
5353
|
return;
|
|
5353
5354
|
}
|
|
5354
|
-
const abi = [
|
|
5355
|
-
{
|
|
5356
|
-
"constant": false,
|
|
5357
|
-
"inputs": [
|
|
5358
|
-
{
|
|
5359
|
-
"name": "_to",
|
|
5360
|
-
"type": "address"
|
|
5361
|
-
},
|
|
5362
|
-
{
|
|
5363
|
-
"name": "_value",
|
|
5364
|
-
"type": "uint256"
|
|
5365
|
-
}
|
|
5366
|
-
],
|
|
5367
|
-
"name": "transfer",
|
|
5368
|
-
"outputs": [
|
|
5369
|
-
{
|
|
5370
|
-
"name": "",
|
|
5371
|
-
"type": "bool"
|
|
5372
|
-
}
|
|
5373
|
-
],
|
|
5374
|
-
"payable": false,
|
|
5375
|
-
"stateMutability": "nonpayable",
|
|
5376
|
-
"type": "function"
|
|
5377
|
-
}
|
|
5378
|
-
];
|
|
5379
5355
|
const viemChain = (0, import_viem11.defineChain)(chain);
|
|
5380
5356
|
const to = isNative ? address : token.address;
|
|
5381
5357
|
const value = isNative ? (0, import_viem11.parseUnits)(amount, parseInt(token?.decimals || "18")) : BigInt(0);
|
|
5382
5358
|
const data = isNative ? "0x" : (0, import_viem11.encodeFunctionData)({
|
|
5383
|
-
abi,
|
|
5359
|
+
abi: import_viem11.erc20Abi,
|
|
5384
5360
|
functionName: "transfer",
|
|
5385
5361
|
args: [address, (0, import_viem11.parseUnits)(amount, parseInt(token?.decimals || "18"))]
|
|
5386
5362
|
});
|