added processing to qortal request

This commit is contained in:
PhilReact 2025-01-04 14:31:33 +02:00
parent d917412988
commit fddcd4ff13
3 changed files with 11 additions and 4 deletions

View File

@ -182,7 +182,7 @@ const UIQortalRequests = [
'GET_WALLET_BALANCE', 'GET_USER_WALLET_INFO', 'GET_CROSSCHAIN_SERVER_INFO', 'GET_WALLET_BALANCE', 'GET_USER_WALLET_INFO', 'GET_CROSSCHAIN_SERVER_INFO',
'GET_TX_ACTIVITY_SUMMARY', 'GET_FOREIGN_FEE', 'UPDATE_FOREIGN_FEE', 'GET_TX_ACTIVITY_SUMMARY', 'GET_FOREIGN_FEE', 'UPDATE_FOREIGN_FEE',
'GET_SERVER_CONNECTION_HISTORY', 'SET_CURRENT_FOREIGN_SERVER', 'GET_SERVER_CONNECTION_HISTORY', 'SET_CURRENT_FOREIGN_SERVER',
'ADD_FOREIGN_SERVER', 'REMOVE_FOREIGN_SERVER', 'GET_DAY_SUMMARY', 'CREATE_TRADE_BUY_ORDER', 'CREATE_TRADE_SELL_ORDER', 'CANCEL_TRADE_SELL_ORDER', 'IS_USING_GATEWAY', 'ADMIN_ACTION', 'SIGN_TRANSACTION', 'OPEN_NEW_TAB', 'CREATE_AND_COPY_EMBED_LINK', 'DECRYPT_QORTAL_GROUP_DATA', 'DECRYPT_DATA_WITH_SHARING_KEY', 'DELETE_HOSTED_DATA', 'GET_HOSTED_DATA' 'ADD_FOREIGN_SERVER', 'REMOVE_FOREIGN_SERVER', 'GET_DAY_SUMMARY', 'CREATE_TRADE_BUY_ORDER', 'CREATE_TRADE_SELL_ORDER', 'CANCEL_TRADE_SELL_ORDER', 'IS_USING_GATEWAY', 'ADMIN_ACTION', 'SIGN_AND_PROCESS_TRANSACTION', 'OPEN_NEW_TAB', 'CREATE_AND_COPY_EMBED_LINK', 'DECRYPT_QORTAL_GROUP_DATA', 'DECRYPT_DATA_WITH_SHARING_KEY', 'DELETE_HOSTED_DATA', 'GET_HOSTED_DATA'
]; ];

View File

@ -729,7 +729,7 @@ export const isRunningGateway = async ()=> {
} }
break; break;
} }
case "SIGN_TRANSACTION": { case "SIGN_AND_PROCESS_TRANSACTION": {
try { try {
const res = await signTransaction(request.payload, isFromExtension) const res = await signTransaction(request.payload, isFromExtension)
event.source.postMessage({ event.source.postMessage({

View File

@ -3423,7 +3423,7 @@ export const signTransaction = async (data, isFromExtension) => {
const decodedData = await response.json(); const decodedData = await response.json();
const resPermission = await getUserPermission( const resPermission = await getUserPermission(
{ {
text1: `Do you give this application permission to sign a transaction?`, text1: `Do you give this application permission to SIGN and PROCESS a transaction?`,
highlightedText: "Read the transaction carefully before accepting!", highlightedText: "Read the transaction carefully before accepting!",
text2: `Tx type: ${decodedData.type}`, text2: `Tx type: ${decodedData.type}`,
json: decodedData, json: decodedData,
@ -3468,7 +3468,14 @@ export const signTransaction = async (data, isFromExtension) => {
keyPair.privateKey keyPair.privateKey
); );
const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature); const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature);
return uint8ArrayToBase64(signedBytes); const signedBytesToBase58 = Base58.encode(signedBytes);
const res = await processTransactionVersion2(signedBytesToBase58);
if (!res?.signature)
throw new Error(
res?.message || "Transaction was not able to be processed"
);
return res;
} else { } else {
throw new Error("User declined request"); throw new Error("User declined request");