diff --git a/packages/ptb-builder/src/Components/Code.tsx b/packages/ptb-builder/src/Components/Code.tsx index 373c472..3e08d9c 100644 --- a/packages/ptb-builder/src/Components/Code.tsx +++ b/packages/ptb-builder/src/Components/Code.tsx @@ -84,7 +84,7 @@ export const Code = ({ onMouseDown={(e) => e.preventDefault()} onClick={handleExcuteTransaction} > - Excute Transaction + Excute )} diff --git a/packages/ptb-builder/src/PTBFlow/nodes/transactions/MergeCoins.tsx b/packages/ptb-builder/src/PTBFlow/nodes/transactions/MergeCoins.tsx index 5385c44..6d138db 100644 --- a/packages/ptb-builder/src/PTBFlow/nodes/transactions/MergeCoins.tsx +++ b/packages/ptb-builder/src/PTBFlow/nodes/transactions/MergeCoins.tsx @@ -2,6 +2,7 @@ import React, { useCallback, useEffect } from 'react'; import { Transaction } from '@mysten/sui/transactions'; import { Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; import { type NodeProp } from '..'; import { PtbHandle, PtbHandleArray, PtbHandleProcess } from '../handles'; @@ -37,6 +38,9 @@ export const MergeCoins = ({ id, data }: NodeProp) => { destination = destNode.source.data.value as string; } else { // TODO + enqueueSnackbar(`not support - ${destNode.source.type}`, { + variant: 'warning', + }); } } @@ -53,6 +57,9 @@ export const MergeCoins = ({ id, data }: NodeProp) => { temp && sources.push(temp.value); } else { // TODO + enqueueSnackbar(`not support - ${inputs.source.type}`, { + variant: 'warning', + }); } } diff --git a/packages/ptb-builder/src/PTBFlow/nodes/transactions/MoveCall.tsx b/packages/ptb-builder/src/PTBFlow/nodes/transactions/MoveCall.tsx index 9fd35a8..0f466cf 100644 --- a/packages/ptb-builder/src/PTBFlow/nodes/transactions/MoveCall.tsx +++ b/packages/ptb-builder/src/PTBFlow/nodes/transactions/MoveCall.tsx @@ -6,6 +6,7 @@ import { } from '@mysten/sui/client'; import { Transaction } from '@mysten/sui/transactions'; import { Node, useReactFlow, useUpdateNodeInternals } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; import { type NodeProp } from '..'; import { useStateContext } from '../../../Provider'; @@ -197,6 +198,7 @@ export const MoveCall = ({ id, data }: NodeProp) => { results: { id: string; value: any }[], ): { transaction: Transaction; result: any } | undefined => { // const params = args.map((item) => (item ? item.name : undefined)); + /* const result = transaction.moveCall({ package: packageId, module: selectedModule, @@ -204,8 +206,13 @@ export const MoveCall = ({ id, data }: NodeProp) => { // arguments: [...params], }); return { transaction, result }; + */ + enqueueSnackbar(`not support - MoveCall`, { + variant: 'warning', + }); + return undefined; }, - [packageId, selectedFunction, selectedModule], + [], ); useEffect(() => { diff --git a/packages/ptb-builder/src/PTBFlow/nodes/transactions/SplitCoins.tsx b/packages/ptb-builder/src/PTBFlow/nodes/transactions/SplitCoins.tsx index 4e80194..ae7f555 100644 --- a/packages/ptb-builder/src/PTBFlow/nodes/transactions/SplitCoins.tsx +++ b/packages/ptb-builder/src/PTBFlow/nodes/transactions/SplitCoins.tsx @@ -2,6 +2,7 @@ import React, { useCallback, useEffect } from 'react'; import { Transaction } from '@mysten/sui/transactions'; import { Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; import { type NodeProp } from '..'; import { useStateContext } from '../../../Provider'; @@ -36,6 +37,9 @@ export const SplitCoins = ({ id, data }: NodeProp) => { coin = transaction.object(coinObject.source.data.value as string); } else { // TODO + enqueueSnackbar(`not support - ${coinObject.source.type}`, { + variant: 'warning', + }); } } const inputs = params.find((item) => item.target === 'amounts:number[]'); @@ -44,6 +48,9 @@ export const SplitCoins = ({ id, data }: NodeProp) => { amounts.push(...(inputs.source.data.value as number[])); } else { // TODO + enqueueSnackbar(`not support - ${inputs.source.type}`, { + variant: 'warning', + }); } } diff --git a/packages/ptb-builder/src/PTBFlow/nodes/transactions/TransferObjects.tsx b/packages/ptb-builder/src/PTBFlow/nodes/transactions/TransferObjects.tsx index 7ca3a36..c7cbf96 100644 --- a/packages/ptb-builder/src/PTBFlow/nodes/transactions/TransferObjects.tsx +++ b/packages/ptb-builder/src/PTBFlow/nodes/transactions/TransferObjects.tsx @@ -2,6 +2,7 @@ import React, { useCallback, useEffect } from 'react'; import { Transaction } from '@mysten/sui/transactions'; import { Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; import { type NodeProp } from '..'; import { PtbHandle, PtbHandleArray, PtbHandleProcess } from '../handles'; @@ -33,6 +34,9 @@ export const TransferObjects = ({ id, data }: NodeProp) => { address = addressNode.source.data.value as string; } else { // TODO + enqueueSnackbar(`not support - ${addressNode.source.type}`, { + variant: 'warning', + }); } } @@ -49,6 +53,9 @@ export const TransferObjects = ({ id, data }: NodeProp) => { temp && objects.push(temp.value); } else { // TODO + enqueueSnackbar(`not support - ${inputs.source.type}`, { + variant: 'warning', + }); } } diff --git a/packages/ptb-builder/src/utils/move/transactions/mergeCoins.ts b/packages/ptb-builder/src/utils/move/transactions/mergeCoins.ts index 0e69ddb..1a0a675 100644 --- a/packages/ptb-builder/src/utils/move/transactions/mergeCoins.ts +++ b/packages/ptb-builder/src/utils/move/transactions/mergeCoins.ts @@ -1,5 +1,6 @@ import { ProgrammableTransaction, SuiTransaction } from '@mysten/sui/client'; import { Edge, Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; export const mergeCoins = ( index: number, @@ -33,6 +34,9 @@ export const mergeCoins = ( }); } else { // TODO + enqueueSnackbar(`not support - ${JSON.stringify(destination)}`, { + variant: 'warning', + }); } } diff --git a/packages/ptb-builder/src/utils/move/transactions/moveCall.ts b/packages/ptb-builder/src/utils/move/transactions/moveCall.ts index d91c43e..a80eb23 100644 --- a/packages/ptb-builder/src/utils/move/transactions/moveCall.ts +++ b/packages/ptb-builder/src/utils/move/transactions/moveCall.ts @@ -1,5 +1,6 @@ import { ProgrammableTransaction, SuiTransaction } from '@mysten/sui/client'; import { Edge, Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; interface MoveCallHandle { id: string; @@ -145,6 +146,9 @@ export const moveCall = ( id: `${PREFIX}${i}`, type: undefined, }); + enqueueSnackbar(`not support - ${JSON.stringify(item)}`, { + variant: 'warning', + }); } } } else { @@ -153,6 +157,9 @@ export const moveCall = ( id: `${PREFIX}${i}`, type: undefined, }); + enqueueSnackbar(`not support - ${JSON.stringify(item)}`, { + variant: 'warning', + }); } }); } diff --git a/packages/ptb-builder/src/utils/move/transactions/splitCoins.ts b/packages/ptb-builder/src/utils/move/transactions/splitCoins.ts index 1483676..87a8045 100644 --- a/packages/ptb-builder/src/utils/move/transactions/splitCoins.ts +++ b/packages/ptb-builder/src/utils/move/transactions/splitCoins.ts @@ -1,5 +1,6 @@ import { ProgrammableTransaction, SuiTransaction } from '@mysten/sui/client'; import { Edge, Node } from '@xyflow/react'; +import { enqueueSnackbar } from 'notistack'; export const splitCoins = ( index: number, @@ -33,6 +34,9 @@ export const splitCoins = ( }); } else { // TODO + enqueueSnackbar(`not support - ${JSON.stringify(coin)}`, { + variant: 'warning', + }); } const arg1: number[] = [];