diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index e08dcf1..b4568b7 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -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; @@ -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: @@ -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);