-
Notifications
You must be signed in to change notification settings - Fork 0
API v1.0.0 index
Emily Liang edited this page Mar 23, 2023
·
10 revisions
{
"powerby": "TideBit-DeFi API v1.0.0",
"success": true,
"code": "00000000",
"message": "Human-readable medium",
"payload": {}
}
- listTickers
- listDepositCryptocurrencies
- listWithdrawCryptocurrencies
- getCandlestickData
- getCFDQuotation
- getTickerHistory
- getGuaranteedStopFeePercentage
- listHistories
- addFavoriteTickers
- removeFavoriteTickers
- listFavoriteTickers
- listBalances
- sendEmailCode
- connectEmail
- connectTideBit
- updateUserIcon
- listSubscribeStatus
- subscribeEmailNotifications
- subscribeNewsletters
- listReadNotifications
- readNotification
- getPNL
- listCFDTrades
- getCFDTrade
- createCFDTrade
- updateCFDTrade
- closeCFDTrade
- listDepositTrades
- createDepositTrade
- listWithdrawTrades
- createWithdrawTrade
- reportIssue
- listNews
- getNews
- listCourses
- getCourse
- listNotifications
- getNotification
- listFAQs
- getFAQ
- listJobs TideBit-DeFi 提供的工作機會
- getJob TideBit-DeFi 提供的工作細節
- applyJob 應徵工作
interface ITickerData {
currency: string;
chain: string;
star: boolean;
starred: boolean;
price: number;
upOrDown: ITrend;
priceChange: number;
fluctuating: number;
tradingVolume: string;
tokenImg: string;
lineGraphProps: ILineGraphProps;
}
type ITrend = "UP" | "DOWN" | "EQUAL"
interface ILineGraphProps {
dataArray?: number[];
strokeColor?: string[];
lineGraphWidth?: string;
lineGraphWidthMobile?: string;
}
interface IApplyOrder {
signature?: string;
}
interface IApplyCFDOrder extends IApplyOrder{
orderType: IOrderType;
type: ICFDOrderType;
data: ApplyCFDOrderData;
}
type IOrderType = 'CFD' | 'DEPOSIT' | 'WITHDRAW' | 'SPOT';
type ICFDOrderType = "CREATE" | "UPDATE" | "CLOSE"
type ApplyCFDOrderData =
| IApplyCreateCFDOrderData
| IApplyUpdateCFDOrderData
| IApplyCloseCFDOrderData;
interface IApplyCreateCFDOrderData {
ticker: string;
quotation: IQuotation; // 報價單
typeOfPosition: ITypeOfPosition;
price: number;
amount: number;
targetAsset: string;
uniAsset: string; // 計價單位(++TODO 有拼錯嗎?)
margin: IMargin;
leverage: number;
liquidationPrice: number; // 強制平倉價格
liquidationTime: number;
guaranteedStop?: boolean;
guaranteedStopFee?: number;
createTimestamp?: number;
takeProfit?: number;
stopLoss?: number;
fee: number;
remark?: string;
}
interface IApplyUpdateCFDOrderData {
orderId: string;
takeProfit?: number;
stopLoss?: number;
guaranteedStop?: boolean;
guaranteedStopFee?: number;
}
interface IApplyCloseCFDOrderData {
orderId: string;
closePrice: number;
quotation: IQuotation;
closeTimestamp?: number;
}
type ITypeOfPosition = 'BUY' | 'SELL';
interface IQuotation {
ticker: string;
targetAsset: string;
uniAsset: string;
price: number;
deadline: number;
signature: string;
}
interface IMargin {
asset: string;
amount: number;
}
interface IApplyDepositOrder extends IApplyOrder {
orderType: IOrderType;
createTimestamp?: number;
targetAmount: number;
targetAsset: string;
decimals: number;
to: string;
remark: string;
fee: number;
}
interface IApplyWithdrawOrder extends IApplyOrder {
orderType: IOrderType;
createTimestamp?: number;
targetAsset: string;
targetAmount: number;
to: string;
remark?: string;
fee: number;
}
interface IAcceptedOrder {
id: string;
orderType: IOrderType;
createTimestamp: number;
orderStatus: IOrderStatusUnion;
}
interface IAcceptedCFDOrder extends IAcceptedOrder {
ticker: string;
state: IOrderState;
typeOfPosition: ITypeOfPosition;
targetAsset: string;
uniAsset: string;
openPrice: number;
amount: number;
leverage: number;
margin: IMargin;
takeProfit?: number;
stopLoss?: number;
fee: number;
guaranteedStop: boolean;
guaranteedStopFee?: number;
liquidationPrice: number;
liquidationTime: number;
closePrice: number;
closeTimestamp?: number;
closedType?: ICFDClosedType;
forcedClose?: boolean;
remark?: string;
}
type ICFDClosedType =
| 'SCHEDULE'
| 'FORCED_LIQUIDATION'
| 'STOP_LOSS'
| 'TAKE_PROFIT'
| 'BY_USER';
type IOrderState = 'OPENING' | 'CLOSED' | 'FREEZED';
interface IAcceptedDepositOrder extends IAcceptedOrder {
targetAsset: string;
targetAmount: number;
decimals: number;
to: string;
remark?: string;
fee: number;
}
interface IAcceptedWithdrawOrder extends IAcceptedOrder {
targetAsset: string;
targetAmount: number;
to: string;
remark?: string;
fee: number;
}
interface ICryptocurrency {
id: string;
icon: string; // svg src
symbol: string; // USDT
name: string; // Tether
decimals: number; // decimal places
contract: string;
fee: number;
}
interface ICandlestickData {
x: Date;
open: number;
high: number;
low: number;
close: number;
}
interface IBalance {
currency: string;
available: number;
locked: number;
}
interface INotification {
id: string;
timestamp: number;
title: string;
content: string;
duration: [number, number];
notificationLevel: INotificationLevel;
isRead: boolean;
public: boolean;
}
interface ITickerHistoryData {
date: Date;
open: number;
}
interface INews {
id: string;
date: Date;
title: string;
subtitle: string;
content: string;
}
interface ICourse {
id: string;
date: Date;
title: string;
subtitle: string;
description: string;
url: string;
}
interface IIssue {
id: string;
date: Date;
title: string;
email: string;
subtitle: string;
content: string;
}
interface ISubscribeData {
type: "EMAIL_NOTIFICATIONS" | "NEWS_LETTERS";
subscribe: boolean;
}
interface ITBEJob {
id: string,
createDate: Date,
jobTitle: string,
location: string,
salary: string,
description: string,
}
interface IFAQs {
id: string;
question: string;
answer: string
}