mirror of
https://github.com/zhigang1992/wallet.git
synced 2026-01-12 22:53:27 +08:00
fix: made requested css and const changes
This commit is contained in:
@@ -52,6 +52,7 @@ export function useBitcoinContracts() {
|
||||
const currentIndex = useCurrentAccountIndex();
|
||||
const nativeSegwitPrivateKeychain =
|
||||
useNativeSegwitActiveNetworkAccountPrivateKeychain()?.(currentIndex);
|
||||
const oracleAPI = 'https://testnet.dlc.link/oracle';
|
||||
|
||||
async function getBitcoinContractInterface(): Promise<JsDLCInterface | undefined> {
|
||||
const bitcoinAccountDetails = getNativeSegwitSigner?.(0);
|
||||
@@ -75,8 +76,6 @@ export function useBitcoinContracts() {
|
||||
signet: BITCOIN_API_BASE_URL_TESTNET,
|
||||
});
|
||||
|
||||
const oracleAPI = 'https://testnet.dlc.link/oracle';
|
||||
|
||||
const bitcoinContractInterface = JsDLCInterface.new(
|
||||
bytesToHex(currentAddressPrivateKey),
|
||||
currentAddress,
|
||||
@@ -127,7 +126,19 @@ export function useBitcoinContracts() {
|
||||
bitcoinContractJSON: string,
|
||||
counterpartyWalletDetails: CounterpartyWalletDetails
|
||||
) {
|
||||
const bitcoinContractInterface = await getBitcoinContractInterface();
|
||||
let bitcoinContractInterface: JsDLCInterface | undefined;
|
||||
try {
|
||||
bitcoinContractInterface = await getBitcoinContractInterface();
|
||||
} catch (error) {
|
||||
navigate(RouteUrls.BitcoinContractLockError, {
|
||||
state: {
|
||||
error,
|
||||
title: 'There was an error with getting the bitcoin contract interface',
|
||||
body: 'Unable to setup interface',
|
||||
},
|
||||
});
|
||||
sendRpcResponse('none', '', 'failed');
|
||||
}
|
||||
|
||||
if (!bitcoinContractInterface) return;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ export function BitcoinContractExpirationDate({
|
||||
expirationDate,
|
||||
}: BitcoinContractExpirationDateProps) {
|
||||
return (
|
||||
<Flex flex={1} width={'284.16px'} paddingLeft={'24px'} paddingRight={'24px'}>
|
||||
<SpaceBetween width={'100%'}>
|
||||
<Flex>
|
||||
<SpaceBetween spacing='base'>
|
||||
<Text fontSize={2} fontWeight="500">
|
||||
Expiration Date
|
||||
</Text>
|
||||
|
||||
@@ -28,7 +28,7 @@ export function BitcoinContractLockAmount({
|
||||
const { onCopy, hasCopied } = useClipboard(hoverLabel ?? '');
|
||||
|
||||
return (
|
||||
<Flag align="middle" img={image ? image : <BtcIcon />} my="loose" spacing="base">
|
||||
<Flag align="middle" img={image || <BtcIcon />} my="loose" spacing="base">
|
||||
<SpaceBetween>
|
||||
<Text fontSize={2} fontWeight="500">
|
||||
{title ? title : 'BTC'}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function BitcoinContractOfferDetailsSimple({
|
||||
/>
|
||||
<BitcoinContractExpirationDate
|
||||
expirationDate={bitcoinContractOffer.bitcoinContractExpirationDate}
|
||||
></BitcoinContractExpirationDate>
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user