Skip to content

Commit bc43e38

Browse files
committed
Update to fetch fees instead of account ID
1 parent e620f7a commit bc43e38

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

src/client.dev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function onClientReady() {
7272
client.executeAction(
7373
{
7474
cex: "mexc",
75-
action: Action.FetchAccountId,
75+
action: Action.FetchFees,
7676
},
7777
metadata,
7878
(err, result) => {

src/proto/node.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,5 @@ enum Action {
5656
FetchCurrency=9;
5757
Call=10;
5858
FetchAccountId=11;
59+
FetchFees= 12;
5960
}

src/server.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,25 @@ export function getServer(
212212
}
213213
break;
214214
}
215-
case Action.FetchAccountId: {
215+
case Action.FetchFees: {
216+
if (!symbol) {
217+
return callback(
218+
{
219+
code: grpc.status.INVALID_ARGUMENT,
220+
message: `ValidationError: Symbol requied`,
221+
},
222+
null,
223+
);
224+
}
216225
try {
217-
let accountId = await broker.fetchAccountId();
226+
const _market = await broker.loadMarkets();
227+
228+
const market =await broker.market(symbol);// Example of Market BTC/USDT
218229

219230
// Return normalized response
220231
return callback(null, {
221232
proof: verityProof,
222-
result: JSON.stringify({ accountId }),
233+
result: JSON.stringify({ generalFee: broker.fees, market }),
223234
});
224235
} catch (error) {
225236
log.error(`Error fetching account ID ${cex}:`, error);

0 commit comments

Comments
 (0)