1
1
import { useCallback , useMemo } from 'react' ;
2
2
3
+ import { KEYRING_TYPE } from '@/shared/constant' ;
3
4
import { RawTxInfo , ToAddressInfo } from '@/shared/types' ;
4
5
import { useTools } from '@/ui/components/ActionComponent' ;
5
6
import { satoshisToAmount , satoshisToBTC , sleep , useWallet } from '@/ui/utils' ;
6
7
import { UnspentOutput } from '@unisat/wallet-sdk' ;
7
8
import { bitcoin } from '@unisat/wallet-sdk/lib/bitcoin-core' ;
8
9
9
- import { KEYRING_TYPE } from '@/shared/constant' ;
10
10
import { AppState } from '..' ;
11
11
import { useAccountAddress , useCurrentAccount } from '../accounts/hooks' ;
12
12
import { accountActions } from '../accounts/reducer' ;
@@ -629,6 +629,7 @@ export function usePrepareSendRunesCallback() {
629
629
const fetchUtxos = useFetchUtxosCallback ( ) ;
630
630
const assetUtxosRunes = useAssetUtxosRunes ( ) ;
631
631
const fetchAssetUtxosRunes = useFetchAssetUtxosRunesCallback ( ) ;
632
+ const account = useCurrentAccount ( ) ;
632
633
return useCallback (
633
634
async ( {
634
635
toAddressInfo,
@@ -666,7 +667,8 @@ export function usePrepareSendRunesCallback() {
666
667
assetUtxos
667
668
} ) ;
668
669
const psbt = bitcoin . Psbt . fromHex ( psbtHex ) ;
669
- const rawtx = psbt . extractTransaction ( ) . toHex ( ) ;
670
+
671
+ const rawtx = account . type === KEYRING_TYPE . KeystoneKeyring ? '' : psbt . extractTransaction ( ) . toHex ( ) ;
670
672
dispatch (
671
673
transactionsActions . updateRunesTx ( {
672
674
rawtx,
@@ -686,7 +688,7 @@ export function usePrepareSendRunesCallback() {
686
688
} ;
687
689
return rawTxInfo ;
688
690
} ,
689
- [ dispatch , wallet , fromAddress , utxos , assetUtxosRunes , fetchAssetUtxosRunes ]
691
+ [ dispatch , wallet , fromAddress , utxos , assetUtxosRunes , fetchAssetUtxosRunes , account ]
690
692
) ;
691
693
}
692
694
0 commit comments