Skip to content

Commit

Permalink
[Issue-3901] feat: one sign tx
Browse files Browse the repository at this point in the history
  • Loading branch information
bluezdot committed Dec 11, 2024
1 parent 02651f9 commit 154e5c6
Showing 1 changed file with 52 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ import { _isPolygonChainBridge } from '@subwallet/extension-base/services/balanc
import { _getAssetDecimals, _getAssetName, _getAssetOriginChain, _getAssetSymbol, _getContractAddressOfToken, _getMultiChainAsset, _getOriginChainOfAsset, _getTokenMinAmount, _isChainEvmCompatible, _isNativeToken, _isTokenTransferredByEvm } from '@subwallet/extension-base/services/chain-service/utils';
import { TON_CHAINS } from '@subwallet/extension-base/services/earning-service/constants';
import { SWTransactionResponse } from '@subwallet/extension-base/services/transaction-service/types';
import { AccountChainType, AccountProxy, AccountProxyType, AccountSignMode, BasicTxWarningCode } from '@subwallet/extension-base/types';
import {

Check failure on line 16 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Import lines must have one element per line. (Expected import to span 10 lines, saw 8)

Check failure on line 16 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Unexpected line break after this opening brace
AccountChainType,
AccountProxy,
AccountProxyType,
AccountSignMode,
BasicTxWarningCode, CommonOptimalPath, DEFAULT_FIRST_STEP,
MOCK_STEP_FEE
} from '@subwallet/extension-base/types';

Check failure on line 23 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Unexpected line break before this closing brace
import { CommonStepType } from '@subwallet/extension-base/types/service-base';
import { _reformatAddressWithChain, detectTranslate, isAccountAll } from '@subwallet/extension-base/utils';
import { AccountAddressSelector, AddressInputNew, AddressInputRef, AlertBox, AlertModal, AmountInput, ChainSelector, HiddenInput, TokenItemType, TokenSelector } from '@subwallet/extension-koni-ui/components';
Expand Down Expand Up @@ -193,6 +200,7 @@ const Component = ({ className = '', isAllAccount, targetAccountProxy }: Compone

const [processState, dispatchProcessState] = useReducer(commonProcessReducer, DEFAULT_COMMON_PROCESS);


Check failure on line 203 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

More than 1 blank line not allowed
const handleWarning = useCallback((warnings: TransactionWarning[]) => {
if (warnings.some((w) => w.warningType === BasicTxWarningCode.NOT_ENOUGH_EXISTENTIAL_DEPOSIT)) {
setForceUpdateMaxValue({});
Expand Down Expand Up @@ -791,27 +799,50 @@ const Component = ({ className = '', isAllAccount, targetAccountProxy }: Compone
}
}, [maxTransfer, transferAmountValue]);

// useEffect(() => {
// getOptimalTransferProcess({
// amount: transferAmountValue,
// address: fromValue,
// originChain: chainValue,
// tokenSlug: assetValue,
// destChain: destChainValue
// })
// .then((result) => {
// dispatchProcessState({
// payload: {
// steps: result.steps,
// feeStructure: result.totalFee
// },
// type: CommonActionType.STEP_CREATE
// });
// })
// .catch((e) => {
// console.log('error', e);
// });
// }, [assetValue, chainValue, destChainValue, fromValue, transferAmountValue]);

useEffect(() => {
getOptimalTransferProcess({
amount: transferAmountValue,
address: fromValue,
originChain: chainValue,
tokenSlug: assetValue,
destChain: destChainValue
})
.then((result) => {
dispatchProcessState({
payload: {
steps: result.steps,
feeStructure: result.totalFee
},
type: CommonActionType.STEP_CREATE
});
})
.catch((e) => {
console.log('error', e);
});
}, [assetValue, chainValue, destChainValue, fromValue, transferAmountValue]);
console.log('ngu')

Check failure on line 825 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Missing semicolon
const result: CommonOptimalPath = {
totalFee: [MOCK_STEP_FEE, MOCK_STEP_FEE],
steps: [
DEFAULT_FIRST_STEP,
{
id: 1,
type: CommonStepType.TRANSFER,
name: 'Transfer'
}
]
}

Check failure on line 836 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Missing semicolon

dispatchProcessState({
payload: {
steps: result.steps,
feeStructure: result.totalFee
},
type: CommonActionType.STEP_CREATE
});
}, [])

Check failure on line 845 in packages/extension-koni-ui/src/Popup/Transaction/variants/SendFund.tsx

View workflow job for this annotation

GitHub Actions / Build Development Preview

Missing semicolon

useRestoreTransaction(form);

Expand Down

0 comments on commit 154e5c6

Please sign in to comment.