Skip to content

Commit

Permalink
refactor: using params directly in send nano contract tx
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabadesso committed Feb 25, 2025
1 parent ecf6825 commit 7f1c5d0
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions packages/hathor-rpc-handler/src/rpcMethods/sendNanoContractTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,7 @@ export async function sendNanoContractTx(
const sendNanoContractTxPrompt: SendNanoContractTxConfirmationPrompt = {
type: TriggerTypes.SendNanoContractTxConfirmationPrompt,
method: rpcRequest.method,
data: {
blueprintId: params.blueprintId,
ncId: params.ncId,
actions: params.actions as NanoContractAction[],
method: params.method,
args: params.args,
pushTx: params.pushTx,
},
data: params,
};

const sendNanoContractTxResponse = await triggerHandler(sendNanoContractTxPrompt, requestMetadata) as SendNanoContractTxConfirmationResponse;
Expand Down Expand Up @@ -112,15 +105,17 @@ export async function sendNanoContractTx(
};
triggerHandler(sendNanoContractLoadingTrigger, requestMetadata);

const txData = {
ncId: params.ncId,
blueprintId: confirmedBluePrintId,
actions: confirmedActions,
args: confirmedArgs,
};

const response = await sendMethod(
params.method,
caller,
{
ncId: params.ncId,
blueprintId: confirmedBluePrintId,
actions: confirmedActions,
args: confirmedArgs,
},
txData,
{
pinCode: pinCodeResponse.data.pinCode,
}
Expand Down

0 comments on commit 7f1c5d0

Please sign in to comment.