Skip to content

Commit

Permalink
fix(exchangeAccount): create fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjeannesson committed Mar 12, 2024
1 parent a539679 commit cb461d1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions desktop-app/renderer/api/exchangeAccounts/exchangeAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface BaseExchangeAccount {
description: string
exchange: string
testing: boolean
privateKey: string
publicKey: string
}
export interface ExchangeAccount extends BaseExchangeAccount {
uuid: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ const defaultExchangeAccount: BaseExchangeAccount = {
name: 'My Exchange Account',
description: 'My Exchange Account Description',
testing: true,
exchange: 'BINANCE'
exchange: 'BINANCE',
privateKey: '',
publicKey: ''
}

export default function CreateExchangeAccountDialog({
Expand All @@ -41,9 +43,7 @@ export default function CreateExchangeAccountDialog({
}): JSX.Element {
const searchParams = useSearchParams()
const [possibleExchanges, setPossibleExchanges] = useState<string[]>([])
const [exchangeAccount, setExchangeAccount] = useState<BaseExchangeAccount>(
defaultExchangeAccount
)

useEffect(() => {
const fetchPossibleExchanges = async () => {
try {
Expand Down Expand Up @@ -118,6 +118,20 @@ export default function CreateExchangeAccountDialog({
type: 'switch',
zod: z.boolean(),
default: defaultExchangeAccount.testing
},
{
label: 'Public API Key',
key: 'publicKey',
type: 'input',
zod: z.string(),
default: defaultExchangeAccount.publicKey
},
{
label: 'Private API Key',
key: 'privateKey',
type: 'input',
zod: z.string(),
default: defaultExchangeAccount.privateKey
}
]}
onSubmit={async (values) => {
Expand Down

0 comments on commit cb461d1

Please sign in to comment.