@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/hooks/index.mjs
CHANGED
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
|
-
|
|
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
|
});
|