mirror of
https://github.com/Qortal/qortal-mobile.git
synced 2025-06-19 14:21:22 +00:00
added txGroupId and chunk status
This commit is contained in:
parent
74d064f735
commit
b2b7820017
@ -358,11 +358,12 @@ export async function sendCoinCase(request, event) {
|
|||||||
|
|
||||||
export async function inviteToGroupCase(request, event) {
|
export async function inviteToGroupCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress, inviteTime } = request.payload;
|
const { groupId, qortalAddress, inviteTime, txGroupId = 0 } = request.payload;
|
||||||
const response = await inviteToGroup({
|
const response = await inviteToGroup({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
inviteTime,
|
inviteTime,
|
||||||
|
txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
@ -483,8 +484,8 @@ export async function createGroupCase(request, event) {
|
|||||||
|
|
||||||
export async function cancelInvitationToGroupCase(request, event) {
|
export async function cancelInvitationToGroupCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress } = request.payload;
|
const { groupId, qortalAddress,txGroupId = 0 } = request.payload;
|
||||||
const response = await cancelInvitationToGroup({ groupId, qortalAddress });
|
const response = await cancelInvitationToGroup({ groupId, qortalAddress, txGroupId });
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
{
|
{
|
||||||
@ -564,11 +565,12 @@ export async function joinGroupCase(request, event) {
|
|||||||
|
|
||||||
export async function kickFromGroupCase(request, event) {
|
export async function kickFromGroupCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress, rBanReason } = request.payload;
|
const { groupId, qortalAddress, rBanReason, txGroupId = 0 } = request.payload;
|
||||||
const response = await kickFromGroup({
|
const response = await kickFromGroup({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanReason,
|
rBanReason,
|
||||||
|
txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
@ -595,12 +597,13 @@ export async function kickFromGroupCase(request, event) {
|
|||||||
|
|
||||||
export async function banFromGroupCase(request, event) {
|
export async function banFromGroupCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress, rBanReason, rBanTime } = request.payload;
|
const { groupId, qortalAddress, rBanReason, rBanTime, txGroupId = 0 } = request.payload;
|
||||||
const response = await banFromGroup({
|
const response = await banFromGroup({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanReason,
|
rBanReason,
|
||||||
rBanTime,
|
rBanTime,
|
||||||
|
txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
@ -734,8 +737,8 @@ export async function getUserSettingsCase(request, event) {
|
|||||||
|
|
||||||
export async function cancelBanCase(request, event) {
|
export async function cancelBanCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress } = request.payload;
|
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||||
const response = await cancelBan({ groupId, qortalAddress });
|
const response = await cancelBan({ groupId, qortalAddress, txGroupId });
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
{
|
{
|
||||||
@ -788,8 +791,8 @@ export async function registerNameCase(request, event) {
|
|||||||
|
|
||||||
export async function makeAdminCase(request, event) {
|
export async function makeAdminCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress } = request.payload;
|
const { groupId, qortalAddress,txGroupId = 0 } = request.payload;
|
||||||
const response = await makeAdmin({ groupId, qortalAddress });
|
const response = await makeAdmin({ groupId, qortalAddress, txGroupId });
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
{
|
{
|
||||||
@ -815,8 +818,8 @@ export async function makeAdminCase(request, event) {
|
|||||||
|
|
||||||
export async function removeAdminCase(request, event) {
|
export async function removeAdminCase(request, event) {
|
||||||
try {
|
try {
|
||||||
const { groupId, qortalAddress } = request.payload;
|
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||||
const response = await removeAdmin({ groupId, qortalAddress });
|
const response = await removeAdmin({ groupId, qortalAddress, txGroupId });
|
||||||
|
|
||||||
event.source.postMessage(
|
event.source.postMessage(
|
||||||
{
|
{
|
||||||
|
@ -2034,7 +2034,7 @@ export async function joinGroup({ groupId }) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
export async function cancelInvitationToGroup({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
const parsedData = resKeyPair;
|
const parsedData = resKeyPair;
|
||||||
@ -2051,6 +2051,7 @@ export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
|||||||
recipient: qortalAddress,
|
recipient: qortalAddress,
|
||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2061,7 +2062,7 @@ export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelBan({ groupId, qortalAddress }) {
|
export async function cancelBan({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
const parsedData = resKeyPair;
|
const parsedData = resKeyPair;
|
||||||
@ -2078,6 +2079,7 @@ export async function cancelBan({ groupId, qortalAddress }) {
|
|||||||
recipient: qortalAddress,
|
recipient: qortalAddress,
|
||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2142,7 +2144,7 @@ export async function updateName({ newName, oldName, description }) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function makeAdmin({ groupId, qortalAddress }) {
|
export async function makeAdmin({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
const parsedData = resKeyPair;
|
const parsedData = resKeyPair;
|
||||||
@ -2159,6 +2161,7 @@ export async function makeAdmin({ groupId, qortalAddress }) {
|
|||||||
recipient: qortalAddress,
|
recipient: qortalAddress,
|
||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2169,7 +2172,7 @@ export async function makeAdmin({ groupId, qortalAddress }) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function removeAdmin({ groupId, qortalAddress }) {
|
export async function removeAdmin({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
const parsedData = resKeyPair;
|
const parsedData = resKeyPair;
|
||||||
@ -2186,6 +2189,7 @@ export async function removeAdmin({ groupId, qortalAddress }) {
|
|||||||
recipient: qortalAddress,
|
recipient: qortalAddress,
|
||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2201,6 +2205,7 @@ export async function banFromGroup({
|
|||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanReason = "",
|
rBanReason = "",
|
||||||
rBanTime,
|
rBanTime,
|
||||||
|
txGroupId = 0
|
||||||
}) {
|
}) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
@ -2220,6 +2225,7 @@ export async function banFromGroup({
|
|||||||
rBanReason: rBanReason,
|
rBanReason: rBanReason,
|
||||||
rBanTime,
|
rBanTime,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2234,6 +2240,7 @@ export async function kickFromGroup({
|
|||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanReason = "",
|
rBanReason = "",
|
||||||
|
txGroupId = 0
|
||||||
}) {
|
}) {
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
const resKeyPair = await getKeyPair();
|
const resKeyPair = await getKeyPair();
|
||||||
@ -2252,6 +2259,7 @@ export async function kickFromGroup({
|
|||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
rBanReason: rBanReason,
|
rBanReason: rBanReason,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2409,7 +2417,8 @@ export async function updateGroup({
|
|||||||
newDescription,
|
newDescription,
|
||||||
newApprovalThreshold,
|
newApprovalThreshold,
|
||||||
newMinimumBlockDelay,
|
newMinimumBlockDelay,
|
||||||
newMaximumBlockDelay
|
newMaximumBlockDelay,
|
||||||
|
txGroupId = 0
|
||||||
}) {
|
}) {
|
||||||
const wallet = await getSaveWallet();
|
const wallet = await getSaveWallet();
|
||||||
const address = wallet.address0;
|
const address = wallet.address0;
|
||||||
@ -2435,6 +2444,7 @@ export async function updateGroup({
|
|||||||
newMinimumBlockDelay,
|
newMinimumBlockDelay,
|
||||||
newMaximumBlockDelay,
|
newMaximumBlockDelay,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
@ -2446,7 +2456,7 @@ export async function updateGroup({
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) {
|
export async function inviteToGroup({ groupId, qortalAddress, inviteTime, txGroupId = 0 }) {
|
||||||
const address = await getNameOrAddress(qortalAddress);
|
const address = await getNameOrAddress(qortalAddress);
|
||||||
if (!address) throw new Error("Cannot find user");
|
if (!address) throw new Error("Cannot find user");
|
||||||
const lastReference = await getLastRef();
|
const lastReference = await getLastRef();
|
||||||
@ -2466,6 +2476,7 @@ export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) {
|
|||||||
rGroupId: groupId,
|
rGroupId: groupId,
|
||||||
rInviteTime: inviteTime,
|
rInviteTime: inviteTime,
|
||||||
lastReference: lastReference,
|
lastReference: lastReference,
|
||||||
|
groupID: txGroupId
|
||||||
});
|
});
|
||||||
|
|
||||||
const signedBytes = Base58.encode(tx.signedBytes);
|
const signedBytes = Base58.encode(tx.signedBytes);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useContext, useEffect, useMemo, useState } from "react";
|
import React, { useCallback, useContext, useEffect, useMemo, useState } from "react";
|
||||||
|
|
||||||
import { Avatar, Box, } from "@mui/material";
|
import { Avatar, Box, } from "@mui/material";
|
||||||
import { Add } from "@mui/icons-material";
|
import { Add } from "@mui/icons-material";
|
||||||
@ -100,6 +100,49 @@ export const AppViewer = React.forwardRef(({ app , hide, isDevMode, skipAuth}, i
|
|||||||
};
|
};
|
||||||
}, [app, path]);
|
}, [app, path]);
|
||||||
|
|
||||||
|
const receiveChunksFunc = useCallback(
|
||||||
|
(e) => {
|
||||||
|
const iframe = iframeRef?.current;
|
||||||
|
if (!iframe || !iframe?.src) return;
|
||||||
|
if (app?.tabId !== e.detail?.tabId) return;
|
||||||
|
const publishLocation = e.detail?.publishLocation;
|
||||||
|
const chunksSubmitted = e.detail?.chunksSubmitted;
|
||||||
|
const totalChunks = e.detail?.totalChunks;
|
||||||
|
try {
|
||||||
|
if (publishLocation === undefined || publishLocation === null) return;
|
||||||
|
const dataToBeSent = {};
|
||||||
|
if (chunksSubmitted !== undefined && chunksSubmitted !== null) {
|
||||||
|
dataToBeSent.chunks = chunksSubmitted;
|
||||||
|
}
|
||||||
|
if (totalChunks !== undefined && totalChunks !== null) {
|
||||||
|
dataToBeSent.totalChunks = totalChunks;
|
||||||
|
}
|
||||||
|
const targetOrigin = new URL(iframe.src).origin;
|
||||||
|
iframe.contentWindow?.postMessage(
|
||||||
|
{
|
||||||
|
action: 'PUBLISH_STATUS',
|
||||||
|
publishLocation,
|
||||||
|
...dataToBeSent,
|
||||||
|
requestedHandler: 'UI',
|
||||||
|
processed: e.detail?.processed || false,
|
||||||
|
},
|
||||||
|
targetOrigin
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to send theme change to iframe:', err);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[iframeRef, app?.tabId]
|
||||||
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
subscribeToEvent('receiveChunks', receiveChunksFunc);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
unsubscribeFromEvent('receiveChunks', receiveChunksFunc);
|
||||||
|
};
|
||||||
|
}, [receiveChunksFunc]);
|
||||||
|
|
||||||
// Function to navigate back in iframe
|
// Function to navigate back in iframe
|
||||||
const navigateBackInIframe = async () => {
|
const navigateBackInIframe = async () => {
|
||||||
if (iframeRef.current && iframeRef.current.contentWindow && history?.currentIndex > 0) {
|
if (iframeRef.current && iframeRef.current.contentWindow && history?.currentIndex > 0) {
|
||||||
|
@ -645,7 +645,7 @@ isDOMContentLoaded: false
|
|||||||
|
|
||||||
const sendMessageToRuntime = (message, eventPort) => {
|
const sendMessageToRuntime = (message, eventPort) => {
|
||||||
window.sendMessage(message.action, message.payload, 300000, message.isExtension, {
|
window.sendMessage(message.action, message.payload, 300000, message.isExtension, {
|
||||||
name: appName, service: appService
|
name: appName, service: appService, tabId,
|
||||||
}, skipAuth)
|
}, skipAuth)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
@ -800,7 +800,7 @@ isDOMContentLoaded: false
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}, [appName, appService]); // Empty dependency array to run once when the component mounts
|
}, [appName, appService, tabId]); // Empty dependency array to run once when the component mounts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import nacl from '../../deps/nacl-fast';
|
|||||||
import utils from '../../utils/utils';
|
import utils from '../../utils/utils';
|
||||||
import { createEndpoint, getBaseApi } from '../../background';
|
import { createEndpoint, getBaseApi } from '../../background';
|
||||||
import { getData } from '../../utils/chromeStorage';
|
import { getData } from '../../utils/chromeStorage';
|
||||||
|
import { executeEvent } from '../../utils/events';
|
||||||
|
|
||||||
export async function reusableGet(endpoint) {
|
export async function reusableGet(endpoint) {
|
||||||
const validApi = await getBaseApi();
|
const validApi = await getBaseApi();
|
||||||
@ -98,6 +99,7 @@ export const publishData = async ({
|
|||||||
tag4,
|
tag4,
|
||||||
tag5,
|
tag5,
|
||||||
feeAmount,
|
feeAmount,
|
||||||
|
appInfo
|
||||||
}: any) => {
|
}: any) => {
|
||||||
const validateName = async (receiverName: string) => {
|
const validateName = async (receiverName: string) => {
|
||||||
return await reusableGet(`/names/${receiverName}`);
|
return await reusableGet(`/names/${receiverName}`);
|
||||||
@ -199,7 +201,17 @@ export const publishData = async ({
|
|||||||
} else {
|
} else {
|
||||||
myResponse = response;
|
myResponse = response;
|
||||||
}
|
}
|
||||||
|
if (appInfo?.tabId) {
|
||||||
|
executeEvent('receiveChunks', {
|
||||||
|
tabId: appInfo.tabId,
|
||||||
|
publishLocation: {
|
||||||
|
name: registeredName,
|
||||||
|
identifier,
|
||||||
|
service,
|
||||||
|
},
|
||||||
|
processed: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
return myResponse;
|
return myResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -312,6 +324,19 @@ export const publishData = async ({
|
|||||||
uploadDataUrl = uploadDataUrl + urlSuffix;
|
uploadDataUrl = uploadDataUrl + urlSuffix;
|
||||||
}
|
}
|
||||||
uploadDataUrl = uploadDataUrl + paramQueries;
|
uploadDataUrl = uploadDataUrl + paramQueries;
|
||||||
|
if (appInfo?.tabId) {
|
||||||
|
executeEvent('receiveChunks', {
|
||||||
|
tabId: appInfo.tabId,
|
||||||
|
publishLocation: {
|
||||||
|
name: registeredName,
|
||||||
|
identifier,
|
||||||
|
service,
|
||||||
|
},
|
||||||
|
chunksSubmitted: 1,
|
||||||
|
totalChunks: 1,
|
||||||
|
processed: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
return await reusablePost(uploadDataUrl, postBody);
|
return await reusablePost(uploadDataUrl, postBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,7 +353,19 @@ export const publishData = async ({
|
|||||||
const chunkSize = 1 * 1024 * 1024; // 1MB
|
const chunkSize = 1 * 1024 * 1024; // 1MB
|
||||||
|
|
||||||
const totalChunks = Math.ceil(file.size / chunkSize);
|
const totalChunks = Math.ceil(file.size / chunkSize);
|
||||||
|
if (appInfo?.tabId) {
|
||||||
|
executeEvent('receiveChunks', {
|
||||||
|
tabId: appInfo.tabId,
|
||||||
|
publishLocation: {
|
||||||
|
name: registeredName,
|
||||||
|
identifier,
|
||||||
|
service,
|
||||||
|
},
|
||||||
|
chunksSubmitted: 0,
|
||||||
|
totalChunks,
|
||||||
|
processed: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
for (let index = 0; index < totalChunks; index++) {
|
for (let index = 0; index < totalChunks; index++) {
|
||||||
const start = index * chunkSize;
|
const start = index * chunkSize;
|
||||||
const end = Math.min(start + chunkSize, file.size);
|
const end = Math.min(start + chunkSize, file.size);
|
||||||
@ -338,6 +375,19 @@ export const publishData = async ({
|
|||||||
formData.append('index', index);
|
formData.append('index', index);
|
||||||
|
|
||||||
await uploadChunkWithRetry(chunkUrl, formData, index);
|
await uploadChunkWithRetry(chunkUrl, formData, index);
|
||||||
|
if (appInfo?.tabId) {
|
||||||
|
executeEvent('receiveChunks', {
|
||||||
|
tabId: appInfo.tabId,
|
||||||
|
publishLocation: {
|
||||||
|
name: registeredName,
|
||||||
|
identifier,
|
||||||
|
service,
|
||||||
|
},
|
||||||
|
chunksSubmitted: index + 1,
|
||||||
|
totalChunks,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const finalizeUrl = uploadDataUrl + `/finalize` + paramQueries;
|
const finalizeUrl = uploadDataUrl + `/finalize` + paramQueries;
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ export const isRunningGateway = async ()=> {
|
|||||||
|
|
||||||
case "PUBLISH_QDN_RESOURCE": {
|
case "PUBLISH_QDN_RESOURCE": {
|
||||||
try {
|
try {
|
||||||
const res = await publishQDNResource(request.payload, event.source, isFromExtension);
|
const res = await publishQDNResource(request.payload, event.source, isFromExtension, appInfo);
|
||||||
event.source.postMessage({
|
event.source.postMessage({
|
||||||
requestId: request.requestId,
|
requestId: request.requestId,
|
||||||
action: request.action,
|
action: request.action,
|
||||||
|
@ -914,7 +914,8 @@ export const deleteListItems = async (data, isFromExtension) => {
|
|||||||
export const publishQDNResource = async (
|
export const publishQDNResource = async (
|
||||||
data: any,
|
data: any,
|
||||||
sender,
|
sender,
|
||||||
isFromExtension
|
isFromExtension,
|
||||||
|
appInfo
|
||||||
) => {
|
) => {
|
||||||
const requiredFields = ['service'];
|
const requiredFields = ['service'];
|
||||||
const missingFields: string[] = [];
|
const missingFields: string[] = [];
|
||||||
@ -1062,6 +1063,7 @@ export const publishQDNResource = async (
|
|||||||
tag5,
|
tag5,
|
||||||
apiVersion: 2,
|
apiVersion: 2,
|
||||||
withFee: true,
|
withFee: true,
|
||||||
|
appInfo
|
||||||
});
|
});
|
||||||
if (resPublish?.signature && hasAppFee && checkbox1) {
|
if (resPublish?.signature && hasAppFee && checkbox1) {
|
||||||
sendCoinFunc(
|
sendCoinFunc(
|
||||||
@ -4237,7 +4239,7 @@ export const inviteToGroupRequest = async (data, isFromExtension) => {
|
|||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.inviteeAddress
|
const qortalAddress = data?.inviteeAddress
|
||||||
const inviteTime = data?.inviteTime
|
const inviteTime = data?.inviteTime
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4267,6 +4269,7 @@ export const inviteToGroupRequest = async (data, isFromExtension) => {
|
|||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
inviteTime,
|
inviteTime,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4291,7 +4294,7 @@ export const kickFromGroupRequest = async (data, isFromExtension) => {
|
|||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
const reason = data?.reason
|
const reason = data?.reason
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4320,7 +4323,8 @@ export const kickFromGroupRequest = async (data, isFromExtension) => {
|
|||||||
const response = await kickFromGroup({
|
const response = await kickFromGroup({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanReason: reason
|
rBanReason: reason,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4346,6 +4350,7 @@ export const banFromGroupRequest = async (data, isFromExtension) => {
|
|||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
const rBanTime = data?.banTime
|
const rBanTime = data?.banTime
|
||||||
const reason = data?.reason
|
const reason = data?.reason
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4375,7 +4380,8 @@ export const banFromGroupRequest = async (data, isFromExtension) => {
|
|||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
rBanTime,
|
rBanTime,
|
||||||
rBanReason: reason
|
rBanReason: reason,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4399,7 +4405,7 @@ export const cancelGroupBanRequest = async (data, isFromExtension) => {
|
|||||||
}
|
}
|
||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4428,6 +4434,7 @@ export const cancelGroupBanRequest = async (data, isFromExtension) => {
|
|||||||
const response = await cancelBan({
|
const response = await cancelBan({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4451,7 +4458,7 @@ export const addGroupAdminRequest = async (data, isFromExtension) => {
|
|||||||
}
|
}
|
||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4480,6 +4487,7 @@ export const addGroupAdminRequest = async (data, isFromExtension) => {
|
|||||||
const response = await makeAdmin({
|
const response = await makeAdmin({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4503,7 +4511,7 @@ export const removeGroupAdminRequest = async (data, isFromExtension) => {
|
|||||||
}
|
}
|
||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4532,6 +4540,7 @@ export const removeGroupAdminRequest = async (data, isFromExtension) => {
|
|||||||
const response = await removeAdmin({
|
const response = await removeAdmin({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4555,7 +4564,7 @@ export const cancelGroupInviteRequest = async (data, isFromExtension) => {
|
|||||||
}
|
}
|
||||||
const groupId = data.groupId
|
const groupId = data.groupId
|
||||||
const qortalAddress = data?.qortalAddress
|
const qortalAddress = data?.qortalAddress
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4584,6 +4593,7 @@ export const cancelGroupInviteRequest = async (data, isFromExtension) => {
|
|||||||
const response = await cancelInvitationToGroup({
|
const response = await cancelInvitationToGroup({
|
||||||
groupId,
|
groupId,
|
||||||
qortalAddress,
|
qortalAddress,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
@ -4713,7 +4723,7 @@ export const updateGroupRequest = async (data, isFromExtension) => {
|
|||||||
const approvalThreshold = +data?.approvalThreshold
|
const approvalThreshold = +data?.approvalThreshold
|
||||||
const minBlock = +data?.minBlock
|
const minBlock = +data?.minBlock
|
||||||
const maxBlock = +data.maxBlock
|
const maxBlock = +data.maxBlock
|
||||||
|
const txGroupId = data?.txGroupId || 0;
|
||||||
let groupInfo = null;
|
let groupInfo = null;
|
||||||
try {
|
try {
|
||||||
const url = await createEndpoint(`/groups/${groupId}`);
|
const url = await createEndpoint(`/groups/${groupId}`);
|
||||||
@ -4748,7 +4758,8 @@ export const updateGroupRequest = async (data, isFromExtension) => {
|
|||||||
newDescription: description,
|
newDescription: description,
|
||||||
newApprovalThreshold: approvalThreshold,
|
newApprovalThreshold: approvalThreshold,
|
||||||
newMinimumBlockDelay: minBlock,
|
newMinimumBlockDelay: minBlock,
|
||||||
newMaximumBlockDelay: maxBlock
|
newMaximumBlockDelay: maxBlock,
|
||||||
|
txGroupId
|
||||||
})
|
})
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user