mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-16 17:14:13 -05:00
amend: remove more dead frontend code
This commit is contained in:
parent
f67e908fb6
commit
4a9e90f99a
3 changed files with 2 additions and 111 deletions
|
|
@ -32,7 +32,6 @@
|
||||||
"@tauri-apps/plugin-shell": "^2.3.0",
|
"@tauri-apps/plugin-shell": "^2.3.0",
|
||||||
"@tauri-apps/plugin-store": "^2.4.0",
|
"@tauri-apps/plugin-store": "^2.4.0",
|
||||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||||
"@types/react-redux": "^7.1.34",
|
|
||||||
"boring-avatars": "^1.11.2",
|
"boring-avatars": "^1.11.2",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"humanize-duration": "^3.32.1",
|
"humanize-duration": "^3.32.1",
|
||||||
|
|
@ -49,6 +48,7 @@
|
||||||
"virtua": "^0.33.2"
|
"virtua": "^0.33.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/react-redux": "^7.1.34",
|
||||||
"@eslint/js": "^9.9.0",
|
"@eslint/js": "^9.9.0",
|
||||||
"@redux-devtools/remote": "^0.9.5",
|
"@redux-devtools/remote": "^0.9.5",
|
||||||
"@tauri-apps/cli": "^2.0.0",
|
"@tauri-apps/cli": "^2.0.0",
|
||||||
|
|
|
||||||
|
|
@ -1,112 +1,4 @@
|
||||||
export enum RpcMethod {
|
// TODO: Auto generate this using typeshare from swap/src/cli/api/request.rs
|
||||||
GET_BTC_BALANCE = "get_bitcoin_balance",
|
|
||||||
WITHDRAW_BTC = "withdraw_btc",
|
|
||||||
BUY_XMR = "buy_xmr",
|
|
||||||
RESUME_SWAP = "resume_swap",
|
|
||||||
LIST_SELLERS = "list_sellers",
|
|
||||||
CANCEL_REFUND_SWAP = "cancel_refund_swap",
|
|
||||||
GET_SWAP_INFO = "get_swap_info",
|
|
||||||
SUSPEND_CURRENT_SWAP = "suspend_current_swap",
|
|
||||||
GET_HISTORY = "get_history",
|
|
||||||
GET_MONERO_RECOVERY_KEYS = "get_monero_recovery_info",
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum RpcProcessStateType {
|
|
||||||
STARTED = "starting...",
|
|
||||||
LISTENING_FOR_CONNECTIONS = "running",
|
|
||||||
EXITED = "exited",
|
|
||||||
NOT_STARTED = "not started",
|
|
||||||
}
|
|
||||||
|
|
||||||
export type RawRpcResponseSuccess<T> = {
|
|
||||||
jsonrpc: string;
|
|
||||||
id: string;
|
|
||||||
result: T;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RawRpcResponseError = {
|
|
||||||
jsonrpc: string;
|
|
||||||
id: string;
|
|
||||||
error: { code: number; message: string };
|
|
||||||
};
|
|
||||||
|
|
||||||
export type RawRpcResponse<T> = RawRpcResponseSuccess<T> | RawRpcResponseError;
|
|
||||||
|
|
||||||
export function isSuccessResponse<T>(
|
|
||||||
response: RawRpcResponse<T>,
|
|
||||||
): response is RawRpcResponseSuccess<T> {
|
|
||||||
return "result" in response;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isErrorResponse<T>(
|
|
||||||
response: RawRpcResponse<T>,
|
|
||||||
): response is RawRpcResponseError {
|
|
||||||
return "error" in response;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RpcSellerStatus {
|
|
||||||
status:
|
|
||||||
| {
|
|
||||||
Online: {
|
|
||||||
price: number;
|
|
||||||
min_quantity: number;
|
|
||||||
max_quantity: number;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
| "Unreachable";
|
|
||||||
multiaddr: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface WithdrawBitcoinResponse {
|
|
||||||
txid: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BuyXmrResponse {
|
|
||||||
swapId: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export type SwapTimelockInfoNone = {
|
|
||||||
None: {
|
|
||||||
blocks_left: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SwapTimelockInfoCancelled = {
|
|
||||||
Cancel: {
|
|
||||||
blocks_left: number;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type SwapTimelockInfoPunished = "Punish";
|
|
||||||
|
|
||||||
export type SwapTimelockInfo =
|
|
||||||
| SwapTimelockInfoNone
|
|
||||||
| SwapTimelockInfoCancelled
|
|
||||||
| SwapTimelockInfoPunished;
|
|
||||||
|
|
||||||
export function isSwapTimelockInfoNone(
|
|
||||||
info: SwapTimelockInfo,
|
|
||||||
): info is SwapTimelockInfoNone {
|
|
||||||
return typeof info === "object" && "None" in info;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isSwapTimelockInfoCancelled(
|
|
||||||
info: SwapTimelockInfo,
|
|
||||||
): info is SwapTimelockInfoCancelled {
|
|
||||||
return typeof info === "object" && "Cancel" in info;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isSwapTimelockInfoPunished(
|
|
||||||
info: SwapTimelockInfo,
|
|
||||||
): info is SwapTimelockInfoPunished {
|
|
||||||
return info === "Punish";
|
|
||||||
}
|
|
||||||
|
|
||||||
export type SwapSellerInfo = {
|
|
||||||
peerId: string;
|
|
||||||
addresses: string[];
|
|
||||||
};
|
|
||||||
|
|
||||||
export type MoneroRecoveryResponse = {
|
export type MoneroRecoveryResponse = {
|
||||||
address: string;
|
address: string;
|
||||||
spend_key: string;
|
spend_key: string;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import ChatIcon from "@mui/icons-material/Chat";
|
||||||
import SendIcon from "@mui/icons-material/Send";
|
import SendIcon from "@mui/icons-material/Send";
|
||||||
import InfoBox from "renderer/components/pages/swap/swap/components/InfoBox";
|
import InfoBox from "renderer/components/pages/swap/swap/components/InfoBox";
|
||||||
import TruncatedText from "renderer/components/other/TruncatedText";
|
import TruncatedText from "renderer/components/other/TruncatedText";
|
||||||
import clsx from "clsx";
|
|
||||||
import {
|
import {
|
||||||
useAppSelector,
|
useAppSelector,
|
||||||
useAppDispatch,
|
useAppDispatch,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue