-
Notifications
You must be signed in to change notification settings - Fork 1
redact update #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redact update #16
Changes from 8 commits
a33b3f2
ea241b8
142c339
66f69a9
b6c4d02
d785a2f
a32720b
1c9e756
a32854f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ export function getServer( | |
| const metadata = call.metadata; | ||
| const { action, cex, symbol } = call.request; | ||
| // Validate required fields | ||
| if (!action || !cex || !symbol) { | ||
| if (!action || !cex) { | ||
| return callback( | ||
| { | ||
| code: grpc.status.INVALID_ARGUMENT, | ||
|
|
@@ -160,6 +160,15 @@ export function getServer( | |
| } | ||
|
|
||
| case Action.FetchDepositAddresses: { | ||
| if (!symbol) { | ||
| return callback( | ||
| { | ||
| code: grpc.status.INVALID_ARGUMENT, | ||
| message: `ValidationError: Symbol requied`, | ||
| }, | ||
| null, | ||
| ); | ||
| } | ||
| const fetchDepositAddressesSchema = Joi.object({ | ||
| chain: Joi.string().required(), | ||
| params: Joi.object() | ||
|
|
@@ -224,6 +233,15 @@ export function getServer( | |
| break; | ||
| } | ||
| case Action.Transfer: { | ||
| if (!symbol) { | ||
| return callback( | ||
| { | ||
| code: grpc.status.INVALID_ARGUMENT, | ||
| message: `ValidationError: Symbol requied`, | ||
| }, | ||
| null, | ||
| ); | ||
| } | ||
| const transferSchema = Joi.object({ | ||
| recipientAddress: Joi.string().required(), | ||
| amount: Joi.number().positive().required(), // Must be a positive number | ||
|
|
@@ -482,9 +500,9 @@ export function getServer( | |
| // Fetch balance from the specified CEX | ||
| const balance = (await broker.fetchFreeBalance({ | ||
| ...(call.request.payload ?? {}), | ||
| // biome-ignore lint/suspicious/noExplicitAny: invalid typing | ||
| // biome-ignore lint/suspicious/noExplicitAny: https://github.com/ccxt/ccxt/issues/26327 | ||
| })) as any; | ||
| const currencyBalance = balance[symbol]; | ||
| const currencyBalance = symbol ? balance[symbol] : balance; | ||
|
|
||
| callback(null, { | ||
| proof: broker.last_proof || "", | ||
|
|
@@ -508,10 +526,9 @@ export function getServer( | |
| case Action.FetchBalances: | ||
| try { | ||
| // Fetch balance from the specified CEX | ||
| const balance = (await broker.fetchFreeBalance({ | ||
| const balance = await broker.fetchFreeBalance({ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oddly here, the result of How does this resolve to an array of balances? Can we add some explaination in comments for this?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The balance struct is incorrect
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The referenced Github Issue (ccxt/ccxt#26327) appears to show that FetchBalance can return a mapping.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. approval need to correct this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix doesn't really solve the root cause of the types issue. It just moves the As detailed in comment, seems to be reported here: ccxt/ccxt#26327
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that was corrected in usherlabs/ccxt#7 |
||
| ...(call.request.payload ?? {}), | ||
| // biome-ignore lint/suspicious/noExplicitAny: invalid typing | ||
| })) as any; | ||
| }); | ||
|
|
||
| callback(null, { | ||
| proof: broker.last_proof || "", | ||
|
|
@@ -530,6 +547,15 @@ export function getServer( | |
| break; | ||
|
|
||
| case Action.FetchTicker: | ||
| if (!symbol) { | ||
| return callback( | ||
| { | ||
| code: grpc.status.INVALID_ARGUMENT, | ||
| message: `ValidationError: Symbol requied`, | ||
| }, | ||
| null, | ||
| ); | ||
| } | ||
| try { | ||
| const ticker = await broker.fetchTicker(symbol); | ||
| callback(null, { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.