Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdvayAgrawal committed Sep 23, 2024
1 parent cde5835 commit 1dc0d3f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,35 @@ static bool handle_ethx_request_withdraw(ethQueryContractUI_t *msg, context_t *c
return ret;
}

static bool handle_kelp_initiate_withdraw(ethQueryContractUI_t *msg, context_t *context) {
bool ret = false;

memset(msg->title, 0, msg->titleLength);
memset(msg->msg, 0, msg->msgLength);

switch (msg->screenIndex) {
case 0:
strlcpy(msg->title, "Unstake", msg->titleLength);
ret = amountToString(context->amount_received,
sizeof(context->amount_received),
WEI_TO_ETHER,
"RSETH",
msg->msg,
msg->msgLength);
break;

case 1:
strlcpy(msg->title, "Asset Expected", msg->titleLength);
strlcpy(msg->msg, context->ticker, msg->msgLength);
ret = true;
break;

default:
PRINTF("Received an invalid screenIndex\n");
}
return ret;
}

void handle_query_contract_ui(ethQueryContractUI_t *msg) {
context_t *context = (context_t *) msg->pluginContext;
bool ret = false;
Expand All @@ -122,6 +151,9 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) {

switch (context->selectorIndex) {
case ETH_MATICX_SUBMIT:
ret = set_stake_ui(msg, context);
break;

case BSC_STAKEMANAGER_REQUEST_WITHDRAW:
case ETH_MATICX_REQUEST_WITHDRAW:
case POLYGON_CHILDPOOL_REQUEST_MATICX_SWAP:
Expand All @@ -133,6 +165,9 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) {
// case BSC_STAKEMANAGER_CLAIM_WITHDRAW:
// selector is same as ETH_MATICX_CLAIM_WITHDRAWAL
case POLYGON_CHILDPOOL_CLAIM_MATICX_SWAP:
ret = set_claim_ui(msg, context);
break;

case POLYGON_CHILDPOOL_SWAP_MATIC_FOR_MATICX_VIA_INSTANT_POOL:
case BSC_STAKEMANAGER_DEPOSIT:
ret = set_native_token_stake_ui(msg);
Expand Down

0 comments on commit 1dc0d3f

Please sign in to comment.