mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-31 14:11:46 +00:00
added txGroupId and event publish status
This commit is contained in:
@@ -358,11 +358,17 @@ export async function sendCoinCase(request, event) {
|
||||
|
||||
export async function inviteToGroupCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress, inviteTime } = request.payload;
|
||||
const {
|
||||
groupId,
|
||||
qortalAddress,
|
||||
inviteTime,
|
||||
txGroupId = 0,
|
||||
} = request.payload;
|
||||
const response = await inviteToGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
inviteTime,
|
||||
txGroupId,
|
||||
});
|
||||
|
||||
event.source.postMessage(
|
||||
@@ -483,8 +489,12 @@ export async function createGroupCase(request, event) {
|
||||
|
||||
export async function cancelInvitationToGroupCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress } = request.payload;
|
||||
const response = await cancelInvitationToGroup({ groupId, qortalAddress });
|
||||
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||
const response = await cancelInvitationToGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
txGroupId,
|
||||
});
|
||||
|
||||
event.source.postMessage(
|
||||
{
|
||||
@@ -564,11 +574,17 @@ export async function joinGroupCase(request, event) {
|
||||
|
||||
export async function kickFromGroupCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress, rBanReason } = request.payload;
|
||||
const {
|
||||
groupId,
|
||||
qortalAddress,
|
||||
rBanReason,
|
||||
txGroupId = 0,
|
||||
} = request.payload;
|
||||
const response = await kickFromGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
rBanReason,
|
||||
txGroupId,
|
||||
});
|
||||
|
||||
event.source.postMessage(
|
||||
@@ -595,12 +611,19 @@ export async function kickFromGroupCase(request, event) {
|
||||
|
||||
export async function banFromGroupCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress, rBanReason, rBanTime } = request.payload;
|
||||
const {
|
||||
groupId,
|
||||
qortalAddress,
|
||||
rBanReason,
|
||||
rBanTime,
|
||||
txGroupId = 0,
|
||||
} = request.payload;
|
||||
const response = await banFromGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
rBanReason,
|
||||
rBanTime,
|
||||
txGroupId,
|
||||
});
|
||||
|
||||
event.source.postMessage(
|
||||
@@ -734,8 +757,8 @@ export async function getUserSettingsCase(request, event) {
|
||||
|
||||
export async function cancelBanCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress } = request.payload;
|
||||
const response = await cancelBan({ groupId, qortalAddress });
|
||||
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||
const response = await cancelBan({ groupId, qortalAddress, txGroupId });
|
||||
|
||||
event.source.postMessage(
|
||||
{
|
||||
@@ -847,8 +870,8 @@ export async function voteOnPollCase(request, event) {
|
||||
|
||||
export async function makeAdminCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress } = request.payload;
|
||||
const response = await makeAdmin({ groupId, qortalAddress });
|
||||
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||
const response = await makeAdmin({ groupId, qortalAddress, txGroupId });
|
||||
|
||||
event.source.postMessage(
|
||||
{
|
||||
@@ -874,8 +897,8 @@ export async function makeAdminCase(request, event) {
|
||||
|
||||
export async function removeAdminCase(request, event) {
|
||||
try {
|
||||
const { groupId, qortalAddress } = request.payload;
|
||||
const response = await removeAdmin({ groupId, qortalAddress });
|
||||
const { groupId, qortalAddress, txGroupId = 0 } = request.payload;
|
||||
const response = await removeAdmin({ groupId, qortalAddress, txGroupId });
|
||||
|
||||
event.source.postMessage(
|
||||
{
|
||||
|
@@ -2069,7 +2069,11 @@ export async function joinGroup({ groupId }) {
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
||||
export async function cancelInvitationToGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
txGroupId = 0,
|
||||
}) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
const parsedData = resKeyPair;
|
||||
@@ -2086,6 +2090,7 @@ export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
||||
recipient: qortalAddress,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2096,7 +2101,7 @@ export async function cancelInvitationToGroup({ groupId, qortalAddress }) {
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function cancelBan({ groupId, qortalAddress }) {
|
||||
export async function cancelBan({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
const parsedData = resKeyPair;
|
||||
@@ -2113,6 +2118,7 @@ export async function cancelBan({ groupId, qortalAddress }) {
|
||||
recipient: qortalAddress,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2175,7 +2181,7 @@ export async function updateName({ newName, oldName, description }) {
|
||||
throw new Error(res?.message || 'Transaction was not able to be processed');
|
||||
return res;
|
||||
}
|
||||
export async function makeAdmin({ groupId, qortalAddress }) {
|
||||
export async function makeAdmin({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
const parsedData = resKeyPair;
|
||||
@@ -2192,6 +2198,7 @@ export async function makeAdmin({ groupId, qortalAddress }) {
|
||||
recipient: qortalAddress,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2202,7 +2209,7 @@ export async function makeAdmin({ groupId, qortalAddress }) {
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function removeAdmin({ groupId, qortalAddress }) {
|
||||
export async function removeAdmin({ groupId, qortalAddress, txGroupId = 0 }) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
const parsedData = resKeyPair;
|
||||
@@ -2219,6 +2226,7 @@ export async function removeAdmin({ groupId, qortalAddress }) {
|
||||
recipient: qortalAddress,
|
||||
rGroupId: groupId,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2234,6 +2242,7 @@ export async function banFromGroup({
|
||||
qortalAddress,
|
||||
rBanReason = '',
|
||||
rBanTime,
|
||||
txGroupId = 0,
|
||||
}) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
@@ -2253,6 +2262,7 @@ export async function banFromGroup({
|
||||
rBanReason: rBanReason,
|
||||
rBanTime,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2267,6 +2277,7 @@ export async function kickFromGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
rBanReason = '',
|
||||
txGroupId = 0,
|
||||
}) {
|
||||
const lastReference = await getLastRef();
|
||||
const resKeyPair = await getKeyPair();
|
||||
@@ -2285,6 +2296,7 @@ export async function kickFromGroup({
|
||||
rGroupId: groupId,
|
||||
rBanReason: rBanReason,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2461,6 +2473,7 @@ export async function updateGroup({
|
||||
newApprovalThreshold,
|
||||
newMinimumBlockDelay,
|
||||
newMaximumBlockDelay,
|
||||
txGroupId = 0,
|
||||
}) {
|
||||
const wallet = await getSaveWallet();
|
||||
const address = wallet.address0;
|
||||
@@ -2486,6 +2499,7 @@ export async function updateGroup({
|
||||
newMinimumBlockDelay,
|
||||
newMaximumBlockDelay,
|
||||
lastReference: lastReference,
|
||||
groupID: txGroupId,
|
||||
});
|
||||
|
||||
const signedBytes = Base58.encode(tx.signedBytes);
|
||||
@@ -2495,7 +2509,12 @@ export async function updateGroup({
|
||||
throw new Error(res?.message || 'Transaction was not able to be processed');
|
||||
return res;
|
||||
}
|
||||
export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) {
|
||||
export async function inviteToGroup({
|
||||
groupId,
|
||||
qortalAddress,
|
||||
inviteTime,
|
||||
txGroupId = 0,
|
||||
}) {
|
||||
const address = await getNameOrAddress(qortalAddress);
|
||||
if (!address) throw new Error('Cannot find user');
|
||||
const lastReference = await getLastRef();
|
||||
@@ -2510,6 +2529,7 @@ export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) {
|
||||
};
|
||||
|
||||
const tx = await createTransaction(29, keyPair, {
|
||||
groupID: txGroupId,
|
||||
fee: feeres.fee,
|
||||
recipient: address,
|
||||
rGroupId: groupId,
|
||||
|
Reference in New Issue
Block a user