Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Updated API types for 3c
Browse files Browse the repository at this point in the history
  • Loading branch information
coltoneshaw committed Dec 1, 2021
1 parent 002c42d commit 112ae0a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
7 changes: 4 additions & 3 deletions src/app/Pages/BotPlanner/BotPlanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import './BotPlanner.scss';
import { calc_dropMetrics } from '@/utils/formulas'
import { Type_Query_bots } from '@/types/3Commas';

const blankObject = {
const blankObject: Type_Query_bots = {
id: Math.random().toString(16).slice(2),
origin: 'custom',
name: 'edit me',
Expand Down Expand Up @@ -41,7 +41,8 @@ const blankObject = {
take_profit_type: '',
strategy: 'long',
stop_loss_percentage: 0,
safety_order_volume_type: '',
safety_order_volume_type: 'quote_currency',
base_order_volume_type: 'quote_currency',
profit_currency: '',
account_name: 'Fake Bot',
account_id: 111111111,
Expand Down Expand Up @@ -146,7 +147,7 @@ const BotPlannerPage = () => {


const addToTable = () => {
updateLocalBotData((prevState: Type_Query_bots[]) => {
updateLocalBotData(prevState => {
return [blankObject, ...prevState]
})
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/3Commas/types/Bots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export type Bots = {
profit_currency: 'quote_currency' | 'base_currency',
min_price: null | 'quote_currency',
max_price: null | 'quote_currency',
stop_loss_type: 'stop_loss',
safety_order_volume_type: 'quote_currency' | 'base_currency',
base_order_volume_type: 'quote_currency' | 'base_currency',
stop_loss_type: 'stop_loss' | 'stop_loss_and_disable_bot'
safety_order_volume_type: 'quote_currency' | 'percent',
base_order_volume_type: 'quote_currency' | 'percent',
account_name: string,
trailing_deviation: string,
finished_deals_profit_usd: string,
Expand Down
8 changes: 4 additions & 4 deletions src/main/3Commas/types/Deals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ export type threeCommas_Api_Deals = {
martingale_step_coefficient: string
stop_loss_percentage: string
error_message: string | null
profit_currency: string
stop_loss_type: string
safety_order_volume_type: string
base_order_volume_type: string
profit_currency: 'quote_currency' | 'base_currency'
stop_loss_type: 'stop_loss' | 'stop_loss_and_disable_bot'
safety_order_volume_type: 'quote_currency' | 'percent'
base_order_volume_type: 'quote_currency' | 'percent'
from_currency: "AUD" | "BIDR" | "BNB" | "BRL" | "BTC" | "BUSD" | "BVND" | "DAI" | "ETH" | "EUR" | "GBP" | "IDRT" | "NGN" | "RUB" | "TRX" | "TRY" | "TUSD" | "UAH" | "USD" | "USDC" | "USDT" | "USDP" | "VAI" | "XRP"
to_currency: string
current_price: string
Expand Down
26 changes: 13 additions & 13 deletions src/types/3Commas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ export type Type_Deals = {
martingale_step_coefficient: number
stop_loss_percentage: number
error_message: string
profit_currency: string
stop_loss_type: string
safety_order_volume_type: string
base_order_volume_type: string
profit_currency: 'quote_currency' | 'base_currency'
stop_loss_type: 'stop_loss' | 'stop_loss_and_disable_bot'
safety_order_volume_type: 'quote_currency' | 'percent'
base_order_volume_type: 'quote_currency' | 'percent'
from_currency: "AUD" | "BIDR" | "BNB" | "BRL" | "BTC" | "BUSD" | "BVND" | "DAI" | "ETH" | "EUR" | "GBP" | "IDRT" | "NGN" | "RUB" | "TRX" | "TRY" | "TUSD" | "UAH" | "USD" | "USDC" | "USDT" | "USDP" | "VAI" | "XRP"
to_currency: string
current_price: number
Expand All @@ -119,7 +119,7 @@ export type Type_Deals = {
trailing_deviation: number
trailing_max_price: number
tsl_max_price: number
strategy: string
strategy: 'long' | 'short'
reserved_quote_funds: string
reserved_base_funds: string
realized_actual_profit_usd: number
Expand Down Expand Up @@ -167,7 +167,9 @@ export type Type_bots ={
active_deals_usd_profit?: number
active_safety_orders_count?: number
base_order_volume: number
base_order_volume_type?: string
safety_order_volume: number
base_order_volume_type: 'quote_currency' | 'percent'
safety_order_volume_type: 'quote_currency' | 'percent'
created_at?: string
updated_at?: string
enabled_active_funds?: number
Expand All @@ -188,8 +190,6 @@ export type Type_bots ={
max_safety_orders: number
profit_currency: string
safety_order_step_percentage: number
safety_order_volume: number
safety_order_volume_type: string
stop_loss_percentage: number
strategy: string
take_profit: number
Expand Down Expand Up @@ -314,11 +314,11 @@ export interface Type_UpdateFunction{
martingale_step_coefficient: number
stop_loss_percentage: number
error_message: string
profit_currency: string
stop_loss_type: string
safety_order_volume_type: string
base_order_volume_type: string
from_currency: string
profit_currency: 'quote_currency' | 'base_currency'
stop_loss_type: 'stop_loss' | 'stop_loss_and_disable_bot'
safety_order_volume_type: 'quote_currency' | 'percent'
base_order_volume_type: 'quote_currency' | 'percent'
from_currency: "AUD" | "BIDR" | "BNB" | "BRL" | "BTC" | "BUSD" | "BVND" | "DAI" | "ETH" | "EUR" | "GBP" | "IDRT" | "NGN" | "RUB" | "TRX" | "TRY" | "TUSD" | "UAH" | "USD" | "USDC" | "USDT" | "USDP" | "VAI" | "XRP"
to_currency: string
current_price: number
take_profit_price: number
Expand Down

0 comments on commit 112ae0a

Please sign in to comment.